CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Struct inside another struct

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ralf



Joined: 21 Feb 2007
Posts: 3

View user's profile Send private message

Struct inside another struct
PostPosted: Wed Feb 21, 2007 4:12 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 21, 2007 1:18 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group