Ralf
Joined: 21 Feb 2007 Posts: 3
|
Struct inside another struct |
Posted: Wed Feb 21, 2007 4:12 am |
|
|
Hi,
i need a struct inside another struct.
But if i make this in line 10
T_MENUZEILE zeile[2];
i get the errors
*** Error 6 "sensor.c" Line 18: String too long
*** Error 43 "sensor.c" Line 19: Expecting a declaration
etc.
With this struct:
typedef struct
{
T_MENUZEILE zeile1;
T_MENUZEILE zeile2;
}T_MENUE;
i get no error.
But its better for my programming to use an array.
What can i do?
Regards Ralf
#define NULL 0
01 typedef struct
02 {
03 char text[32];
04 char *function;
05 char *menu;
06 }T_MENUZEILE;
07
08 typedef struct
09 {
10 T_MENUZEILE zeile[2];
11 }T_MENUE;
12
13 T_MENUE menue;
14
15 const T_MENUZEILE test1111 = {" t ", NULL, NULL};
16
17 const T_MENUE menuVersion = {
18 " 0 ", NULL, NULL,
19 " 0 ", NULL, NULL
20 }; |
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 21, 2007 1:18 pm |
|
|
When you post code, use the Code button to display it in a code block.
Don't use the List button. Also, don't use line numbers. The main
reason no one has replied is because they don't want to look at the
line numbers.
Code posted in a code block looks like this:
Code: | typedef struct
{
T_MENUZEILE zeile1;
T_MENUZEILE zeile2;
}T_MENUE; |
Use the Preview button to inspect your post before you submit it. |
|