Hi,
How should I go about writin a function that takes no args and returns a pointer to a structure. the function prompts the user for some personal info and stores it in a structure.
Now, I am new at using function with pointers, but I am assuming that the declaration would look like:
Info* getdata ();
the struct definition could look something like
struct INFO{
char name[];
int age;
};
typedef struct INFO Info;
the function would ask the user to enter name, then to enter age.
how do you store the name and the age when you do the scanf?
Now what should the function def look like?
Thank you.
Any additional info on functions that return pointers would be appreciated.