Ok, Structs, I need help I am not familiar with them

This is a discussion on Ok, Structs, I need help I am not familiar with them within the C++ Programming forums, part of the General Programming Boards category; Ok so I've read a book on C++ and whatnot, but it didn't really say what a struct was, it ...

Ok, Structs, I need help I am not familiar with them

Ok so I've read a book on C++ and whatnot, but it didn't really say what a struct was, it just mentioned that it was a cousin of a class and some other stuff. Now that I am reading Petzold's book, which uses C not C++ I've stumbled upon the following header file..............

Just glancing over it I can deduce the following. The member iIndex is an offset into the array of descriptions and labels. The 2 pointers are to the actual Label and Description. So, I'm not sure what exactly you are asking or if that answered anything? Structs are similiar to classes (kind of) but one important difference is that all of the struct data members are public. Any specific questions, just shoot.

a C struct is different. the struct you posted makes a struct with the elements iIndex, szLabel, and szDesc, whose array is named sysmetrics. from there on the various elements are being initialized. to make it easier i'll post a similar example: