Alright. I picked up most of my programming knowledge outside a classroom setting, and outside of situations like these I'm generally the only one who sees my code, so I never really learned the conventions. I'll try to pay more attention to them next time I have someone look over some code. In the meantime, thanks again for all your help, that should hopefully be enough for me to work with for now.
Ungh, I'm sorry. Your first response and my quick reading made me think that the instance of the structure was called players; also, I'm following a convention where class names tend to be capitalized. (Having a good naming convention avoids a lot of potential confusion.) So you're right: if the variable is called player, then you access it with just player.
Ok, I'm confused.
[code]struct players {
std::string name;
Socket *connection;
} player [100];
[/code]
I was under the impression that you access an individual member the structure using the bottom line. In this case I was attempting to compare a single object of the "players" type, not the "players" structure itself. I read [url=http://www.cplusplus.com/doc/tutorial/structures.html]here[/url]:
[quote][code]
struct product {
int weight;
float price;
} apple, banana, melon;
Ah, I hadn't noticed that it was missing the "int", too. Good catch on that on.
As for "players" vs. "player[x]": If the structure is called "players", then the only way to access it is using "players" -- if you use "player" and that works, then you're not talking to what you think you are. C/C++ are extremely literal this way: you will get [i]exactly[/i] what you type; it does not do any clever things for you. :smile:
Ah that was it, it was the capitalization. I also needed to put an "int" before number, and add another "=" like you said.
For the record, I'm not sure, but I think even though the structure is called players, the individual members are called "player[x]". At any rate, it compiled ok without the "s", I need to go really soon, otherwise I'd try running the program. Thank you very, very, much for all your patience and help everyone.