G
gnat
Hello comp.lang.c,
given the code:
static char *name[] = {
"Bob", "Jane", "Superman", "Joe Sixpack"
};
Since i have not specified the size of the array the compiler
will count the initializers and fill in the correct number. How
do i find out what number the compiler has chosen? how do i find
out what the array size is so i don't overflow it by accident?
I have taken to putting a string ("000000") at the end and
checking for it when i loop through it stopping when i find it,
but i think that there must be a better way.
given the code:
static char *name[] = {
"Bob", "Jane", "Superman", "Joe Sixpack"
};
Since i have not specified the size of the array the compiler
will count the initializers and fill in the correct number. How
do i find out what number the compiler has chosen? how do i find
out what the array size is so i don't overflow it by accident?
I have taken to putting a string ("000000") at the end and
checking for it when i loop through it stopping when i find it,
but i think that there must be a better way.