i would like (if it is possible) someone to explain the program. i know that it is not a complete program but...i have the following questions...
(1) is this the same as
?Code:char name[];
if 'yes' what is the difference?
(2) is the following a correct way of calling the function from main()?
if 'yes' what is the difference of this:Code:int main(void){ init(*p); }
and lastly i want to know what -> is? can i have some more details about this please, cause i don' t understand...Code:int main(void){ init(p); }
thank you all....Code:#include <stdio.h> struct Person{ char *name; // (1) int age; }; void init(struct Person *p){ // (2) p->name = (char *)malloc(10*sizeof(char)); p->age = 0; }