c - What is the identifier of typedef struct -
I came to learn the linked list. But, I am quite confused in many ways to declare linked lists with struct.
This is a method, And this is another way type is not typed I'm curious, when we are announcing with You can alternatively assign a tag to a structure, such as Now the common identifier is a type of name in the namespace, which is synonym or surname for Note that you can also write: The first row says that 'Tag' Note that this question has been tagged, and you are receiving direct answer ( Which is good). However, if you have to face C ++, then you feel that: is valid C ++ and the common identifier namespace (plus the structure in the tag typingff structure noodt {int dataNum; Struct notepad * nextNode; } NODE;
struct NODE {int dataNum; Struct NODE * nextNode; }; typedef , I know that notettext to know the compiler Used for the straight notetag * next node; . But then, what is the real identifier of struct ? Notetag or NODE ? If this is notettext , then when is NODE ? struct nodetag < / Code> or struct NODE . These tags (and union tags, and em tags) are in namespace separate from the common identifier. creates a nickname for typed f version struct nodetag :
typed node tag { ...} NODE; struct nodetag . >
typedef struct noettag NODE; Structure Knowtag {Int dataNum; Node * Agnolode; }; notetag and NODE are the nickname for this type with a composition type exists' second The block says that struct nodetag belongs to these items, lists a NODE * as one of the members.
C and C ++ are two different languages
struct nodetag {int dataNum; Notatag * Agalanod; }; notetag ) tag namespace. It is not valid in C. If you end up using the C ++ compiler to compile the C code, you may get confused.
Comments
Post a Comment