Jump to content

Talk:Typedef: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
SineBot (talk | contribs)
m Automatically signing comment made by 155.148.36.138
Line 36: Line 36:


The word "struct" is required before the phrase "mytype* next;"
The word "struct" is required before the phrase "mytype* next;"
The GNU C compiler (3.4.6) warns that "aptr->next = bptr;" is an assignment of incompatible pointer types.
The GNU C compiler (3.4.6) warns that "aptr->next = bptr;" is an assignment of incompatible pointer types. <small>—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/155.148.36.138|155.148.36.138]] ([[User talk:155.148.36.138|talk]]) 14:31, 6 September 2007 (UTC)</small><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->

Revision as of 14:32, 6 September 2007

Can anyone tell me what typedef uint32 A; would do  ?


It would create a new type named 'A' that would essentially just be an alias for uint32. You could then create variables like this: 'A newvariables = 3;' Jaddle 17:06, 14 May 2007 (UTC)[reply]

= 3 --193.136.128.14 13:12, 17 May 2007 (UTC)[reply]


It would be nice to have an explanation of the syntax of recursive typedefs

For example, in C:

int main() {

typedef struct { int key; struct mytype* next; } MyType;

MyType a; MyType b;

MyType* aptr; MyType* bptr;

aptr = &a; bptr = &b;

aptr->key = 3; aptr->next = bptr;

}

The word "struct" is required before the phrase "mytype* next;" The GNU C compiler (3.4.6) warns that "aptr->next = bptr;" is an assignment of incompatible pointer types. —Preceding unsigned comment added by 155.148.36.138 (talk) 14:31, 6 September 2007 (UTC)[reply]