D
dmp
How to create a structure inside structure?
dmp said:How to create a structure inside structure?
I think this nesting declaration of structure is not allowed in c.dmp said:How to create a structure inside structure?
The usual way is to write code. What did you try and how didn't it
work?
[I'd do something like
struct outer { int spoo; struct inner { long tube; }; };
Chris forgot the tag for the inner structure; it should be
struct outer { int spoo; struct inner { long tube; }; foo };
[/QUOTE]struct outer { int spoo; struct inner { long tube; }; };
I think this nesting declaration of structure is not allowed in c.
compiling this declaration would generate an error.
Correct use would be as
struct inner
{
long tube;
}str1;
struct outer
{
int spoo;
str1 inn; //inner structure's object
};
Richard said:Chris forgot the tag for the inner structure; it should be
struct outer { int spoo; struct inner { long tube; }; foo };
Chris forgot the tag for the inner structure; it should be
And you got it wrongtoo.
Richard said:Isn't 'inner' the tag? Chris forgot the variable name.
YesLet's hope we have exhausted the possible mistakes here...
Richard said:Isn't 'inner' the tag? Chris forgot the variable name.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.