I know this might sound stupid, but I want to use a function to assign my own data type..
What I want is for my_function to return an integer value to indicate the functions success or failure. This I know how to do..Code:#include <stdio.h> #include <stdlib.h> typedef unsigned char byte; typedef struct { byte header[15]; int a; int b; byte *data; } MY_TYPE; int my_function(MY_TYPE mt) { } int main() { int er; MY_TYPE a; er = my_function(a); }
But I want my_function's My_TYPE mt, to be equal to the main's MY_TYPE a, after the function is called..
Here's my problem, I want to do it without making ANY of the variables GLOBAL.
Any help would be great..