1 #include <stdio.h> 2 3 struct mytype 4 { 5 void *myptr; 6 int myval; 7 }; 8 9 int a; 10 int b; 11 12 struct mytype mystructs[2] = {{&a, 10}, {&b, 20}}; 13 myfunc(int input)14void *myfunc(int input) 15 { 16 if (input < 2 && input >= 0) 17 { 18 return mystructs[input].myptr; 19 } 20 else 21 { 22 return 0; 23 } 24 } 25 myfunc2(int input)26int myfunc2(int input) 27 { 28 if (input == 3) 29 return input + 3; 30 else 31 return 0; 32 } 33 main()34int main() 35 { 36 int input; 37 scanf("%d", &input); 38 printf("%d\n", input); 39 printf("%p\n",myfunc(input)); 40 printf("%d\n",myfunc2(input)); 41 return 0; 42 } 43