J
Jason A.
Hello,
I am trying to declare 2 structures, and another one other that
contains the first two, so that I can iterate more easily
thru all the members.. Unfortunatly the compiler complains that
structure X has no member named: `table'
tabstruct.c:34: structure has no member named `table'
tabstruct.c:35: structure has no member named `table'
I guess I haven't understood something about declaring structures.
What is my mistake ? Is it because the compiler doesn't now what
size the original structure is ??
#include <stdio.h>
#define WHITE 0
#define BLUE 1
struct white {
char name[12];
int red;
int green;
int blue;
} whitetab[] = {
{ "kk", 1, 2, 3 },
{ "kj", 4, 5, 6 }
};
struct blue {
char name[12];
int red;
int green;
int blue;
} bluetab[] = {
{ "tt", 1, 2, 3 },
{ "tx", 4, 5, 6 },
{ "tf", 8, 11, 4 }
};
struct tables_ {
struct table;
int count;
} kolor[2];
int main(void) {
kolor[WHITE].table = whitetab;
kolor[BLUE].table = bluetab;
return 0;
}
I am trying to declare 2 structures, and another one other that
contains the first two, so that I can iterate more easily
thru all the members.. Unfortunatly the compiler complains that
structure X has no member named: `table'
tabstruct.c:34: structure has no member named `table'
tabstruct.c:35: structure has no member named `table'
I guess I haven't understood something about declaring structures.
What is my mistake ? Is it because the compiler doesn't now what
size the original structure is ??
#include <stdio.h>
#define WHITE 0
#define BLUE 1
struct white {
char name[12];
int red;
int green;
int blue;
} whitetab[] = {
{ "kk", 1, 2, 3 },
{ "kj", 4, 5, 6 }
};
struct blue {
char name[12];
int red;
int green;
int blue;
} bluetab[] = {
{ "tt", 1, 2, 3 },
{ "tx", 4, 5, 6 },
{ "tf", 8, 11, 4 }
};
struct tables_ {
struct table;
int count;
} kolor[2];
int main(void) {
kolor[WHITE].table = whitetab;
kolor[BLUE].table = bluetab;
return 0;
}