several beginner questions...
First question:
I am wondering if there is a way to loop through structures. I can see how this might be bad form and an even worse way to make a reliable program but its more out of curiosity than anything I need to use.
In VB there was a "for each" statement that would loop through everything in a class is there something similar in C?
Second Question:
I know there are many many posts on headers and a faq I read a majority of them that actually dealt with the creation and format but Im still not quite sure I get it.
Code:
someheader.h
struct somestruct{
int someint;
float somefloat;
char somechar;
char somestring[10];
};
and then in a C file
Code:
someheader.c
#include <someheader.h>
int main()
{
struct somestruct NewStruct = {0,0,"",""};
goodfunction(NewStruct);
return 0;
}
struct somestruct goodfunction(struct somestruct NewStruct)
{
useful code here;
here too;
some good stuff here as well;
return NewStruct;
}
and then compile them together?
Is that right at all?
How does the data get passed between the two files? How does the program I use it in know whats in the file?
As a bit of the why to this post and probably several more. I am a full time student. I am in an Into to C course. This is for me not for class I could write those in my sleep right now. The instructor doesn't teach fast enough or go in depth very much. :(
Last question is what is a good resource to learn the network end of C, there seems to be a few different standards of C and I know there are a few different network types even though I think most these days are ethernet and I couldnt get near a fiber network if I wanted too so I think Im looking for mostly basic things that arent dependant on 1 os or 1 network type.
Feel free to rip apart my little code example and make jokes about it...just tell me why, can't fix what you don't see.