-
Code:
struct {
int iIndex;
char * szlabel;
char * szdesc;
}
This defines a structure. The next bit is just a statically-allocated array of these structures, initialised as you can see.
Code:
#define NUMLINES (int)(sizeof sysmetrics / sizeof sysmetrics [0])
This cryptic-looking line is actually quite simple. It divides the size in bytes of the ENTIRE array by the size of one of those elements, giving the number of items entered. It's a quicker way that counting them and hard-coding that number.
-
OK, here is a simple one
I saw this one too
static
{
int index;
char vari;
}
now you have closed the brakets and you define some like this
thevar[]
{
1, "great",
2, "then great"
};
why is:
thevar[0].index = 1
thevar[1].vari = "great"
and
thevar[1].index = 2
thevar[1].vari = "then great"
It is hard to explain it but that is something i am confised about beause you have just commas between two words and they are is certain variable.
-
It's shorthand for defining a struct:
Code:
struct x {
int y;
bool z;
}
x theStruct = {56, false};