struct S {int a; float b; char c[4]; }; struct S s1 = {.c = "abc"};
This gives me at compiler error #29, but it should be supported in C99 right?
interesting , up to now I was not aware of that kind of initialization.
Google led me here linuxprograms.wordpress.com/.../
where a full init is done.
this example does not compile on my Keil too. (C Compiler: Armcc.Exe V4.0.0.524)
So I assume Keil lacks a bit of compatibility here.
You may use this instead, this one compiles
struct S {int a; float b; char c[4]; }; struct S s1 = {0.0,0.0,"abc"};
regards Uli
Only if you have correctly configured the compiler to operate in C99 mode:
www.keil.com/.../armccref_babdhcga.htm
www.keil.com/.../armccref_babibbfi.htm
www.keil.com/.../armccref_BABCFABB.htm
thanx Andy,
so it was just a matter of Please read the manual, as often. the sample compiles fine with --c99 set ;))
ULI
Indeed!
But I think TFM could have been more helpful in pointing out more clearly that C99 is disabled unless specifically requested...
Thanks, It works here too now.. Best regards Jesper