Please Quzah or Salem, give me a hand here.
Please Quzah or Salem, give me a hand here.
Of course this is a C++ forum. But C++ incorporates C90 at least to a degree.
Here we see that,Yet this would not appear to be what is occurring, and it does appear to be language dependent.The initializer for a scalar shall be a single expression, optionally enclosed in braces.
Yes, you've pinpointed the issue in C++. My question was in regard to a reference to where exactly the difference might be highlighted in a C++ reference.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
You'd think after they posted the struct definition, the initialization would become obvious.
>The initializer for a scalar shall be a single expression, optionally enclosed in braces.
Well, I didn't think an array was a scalar.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
But if I get what you're saying, this should compile either way. So maybe he's using:
When he should be using:Code:gcc EmRegs328.cpp
Code:g++ EmRegs328.cpp
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
But my feeling is if you're going to use brackets, use them for all scalars, which is not the case here. But perhaps the inconsistency does not bother you.
>S/He's compiling C++ as C++.
I don't think so. Because if that was the case, then according to you, it would have compiled. Or maybe I'm missing something.
Please stay on the topic you're tying a grill my butt for. This is not about consistency, it's about correctness.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Here's my interpretation of your take. The braces are optional in C++. Thus the original code should have compiled. Correct?
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*