How to use enum within a struct in ANSI C? -


The following code is to be used in the main code, but I do not know how it is used.

  START A few ITEM {enum {MOVIE, MUSIC} item type; Association (structure film * movie; composition music * music;};};  

This structure is used in a dynamic link list with previous / item / next indicator, but not me Find out how you can set an enum or how to get started.

I have to know how this is seen in the main function.

biglist.someitem = ';; / * Declaration I * / struct Library * Use a large list;

To understand more code that I do Is trying to.

Struct library {struct SomeItem * someitem; straight Some Itam * Previous Itam; Straight Some Itam * Next Entom;}; C2037: Contiller Ideals: C2037: Regardless of 'something', the undefined structure / union specifies 'Library' C2065: Film: Undeclared identifier

Still a rookie on ANSI C, do not hit me properly;)

< / Div>

You are using points everywhere, so you can use Mitigation requires -> refer to the item.

Meaning biglist-> Someitem-> ItemType = MOVIE;

The code below is compiled exactly with gcc -Wall-strict:

{ENG} type {MOVIE, MUSIC} item type; Structure (structure film * movie; composition music * music;} item;}; structure library {strait someItem * someitem; straight some itam * previous itam; straight some etam * next int;}; int main (zero) {struct library * Big list-> Biglist-> itemty = MOVIE; return 0;}

(Although this code will not run definitely because I have a large list and someitem No memory for me!)


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -