dynamically allocated strings??
Ok, part of my assignment for school is to create a struct with 2 char pointers in it. These pointers are supposed to point to a couple of dynamically allocated strings and I'm supposed to create a little function that prints the contents of the struct out. So far I have the struct:
And I have the print function:
I think those two parts are right. My question is about the dynamically allocated strings that the pointers in my struct are supposed to point to. I'm not quite sure of how to do that..
void printMyStruct(myStruct *a, myStruct *b)
printf("%s: %s\n", *(a).name, *(b).number);