Code:
#include <stdio.h>
#include <stdlib.h>
typedef int gbType(int);
int *createFunction(int x);
int main(){
gbType *foo = createFunction(35);
printf("%d\n", *foo);
free(foo);
return 0;
}
int *createFunction(int x){
int *var;
var = malloc(sizeof(int));
*var = x;
return var;
}
Code:
test.c: In function 'main':
test.c:9:19: warning: initialization from incompatible pointer type [enabled by default]
gbType *foo = createFunction(35);
Well it's not really an error...but why am I getting warning? and is there way to remove this warning?