heyho
my compiler gives me a warning but i dont know why:
the code works but the warning is making me think.Code:#include<stdio.h> void print(struct msg *ptr); int main() { struct msg { int num; } in; int *num; num = &in.num; printf("enter some number: "); scanf("%d", &num); print(num); //compiler warning: suspicious pointer conversion return 0; } void print(struct msg *ptr) { printf("the value is %d", ptr); }
do you know why the compiler warns me?
thanks