I'm a begginer and have been reading books on C, I have a question about pointers of structures.
Below I tried to initialize members of the structure using a "*p" pointer
struct part *p; //creating a pointer with 'struct part' type
p->num= 5; //initializing
You declared a pointer but it doesnt point to anything.
You'd have to do e.g.
p = malloc(sizeof(struct part)) or maybe
struct part q; p = &q; or otherwise set it to point to something first.
Check out the C version of this old classic.