
January 17th, 2004, 06:34 PM
|
 |
Contributing User
|
|
Join Date: Dec 2003
Location: Houston, TX
Posts: 161
Time spent in forums: 12 h 12 m 50 sec
Reputation Power: 10
|
|
Your struct code should look like this, I believe:
Code:
struct REL {
char JUNK[17];
char RIB[3]
};
REL rel; //defines a structure rel of type REL
So, rel is the name of a structure REL, and the char array RIB is referenced by rel.RIB[0], like narbo showed. If you created a pointer to the structure, then you would use -> notation...
Code:
struct REL *r; //creates a pointer of type struct REL
r=&rel; //points r to the address of structure rel
cout<<r->RIB[0];
Hope this helps you understand why it works that way!
-Tim
|