Hi all, I'm having yet another problem with my program. What I'm attempting to do is pass information stored in members of structures to a different function to print them to the screen. I can't quite figure out how to get them to pass back to main.. maybe you guys can help. I've included the code of the two functions here:
You could pass the struct in as a pointer and then access the members from there, for example: void printStatistics(StructName* t) and then you can access the members like t->member
Also, i don't see where you declared your struct, but if you do it like this:
1 2 3
typedefstruct Sname {
//info
} Sname;
then you don't have to use struct Sname blah you can just say Sname blah
I've kind of got an idea of how that works.. my misunderstanding is that the first function is what stores information in the members of the structure, whereas the second one accesses it. So how do I go about returning it to the main function and pass into the second one? Maybe this is a silly question but I'm really struggling with it, and it is one of the last things left to complete this program.