I'm declaring a struct in the IDE (Netbeans) like this:
struct foo {
size_t var = 1;
}
And the IDE says its legal. I compile the project (its a static lib..) and the compiler says its legal (does not moan or throw).
Now since I'm just testing the syntax at this point I have to ask someone who might know if this will actually work when I go to declare a struct of this tag in my procedures like this:
struct foo myfoo;
So the question is: Is that a valid initalizer? (size_t var = 1
) or is the compiler just stroking my ego here? I haven't found anything on google or in documentation like this so I'm guessing it doesn't work the way I hope it will.
*edit So me and the Good 'ol boys here @SO figured out that it will compile in a debug configuration but not a release configuration. Who says one head is better than a couple thousand? :D