|
Page 1 of 1
|
[ 2 posts ] |
|
initialization of structures.
| Author |
Message |
|
stevedh
Rookie
Joined: Wed Nov 14, 2012 4:22 am Posts: 2
|
 initialization of structures.
I came across a thread about this from then end of 2009 and again at the start of this year.. however they had compiler errors, and I don't so I assumed this feature had now been added, although admitedly nothing in the change logs.
If I try to statically initialize an array of structures I don't get any errors, but the structure elements are all zero.
typedef struct { int a; int b; int c; } S;
S g_Array[3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
if I try to initialize a single element
S g_S = {1,2,3};
same thing
if I try to runtime initialize like this I get
**Error**:No code generation yet for dynamic initialization of 'struct' variables
so does that mean that at some future date, not to far away, static initialization of stucture arrays will happen?
thanks Steve
|
| Sun Dec 30, 2012 3:49 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2858 Location: Rotterdam, The Netherlands
|
 Re: initialization of structures.
Maybe, but I wouldn't hold my breath just yet  = Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Mon Dec 31, 2012 3:15 am |
|
|
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
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 post attachments in this forum
|
|