Wow, I am dumb. I didn't even think to look BEFORE the cout that was on line 6... |
No worries, took me a bit to get used to the compiler messages also.
Apparently, the last version of Dev (4.9.9?) hasn't been updated in about 5 years (and that's beta to boot).
DevC++ did go on to have something to do with wxWidgets I think (another compiler I've seen recommended here), but I haven't played around with it. CB has an addon for wxWidgets I see though, but still haven't gotten to it. I'm pretty partial to CodeBlocks... there's tons of options and customization and compiler seems to be (in my limited experience) good.
The alternative thing there, would that work for all objects? I would assume yes but confirmation would be nice. |
Yea, pretty much. It's all one large statement, and the statement doesn't end until a ; is reached (or a closing bracket }, as the brackets {} denote a series of statements). The concept is called whitespace. Spaces, lines, tabs, etc etc, they don't matter. This is perfectly legal:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
int main()
{
cout
<<
"yay!"
<< "blah"
;
}
|
... which is the exact equivelant to:
|
int main(){cout<<"yay!blah";}
|
It boils down to readability and coding style.
hth
edit: note that there are a few subtleties to the closing line/closing bracket things. Classes, for instace, require a closing line at the end of the bracket:
1 2 3 4 5
|
class MyClass
{
public:
void MyMemberFunction();
};
|
where "if" statements have a syntax:
1 2 3 4 5 6 7
|
int SomeFunc()
{
if (expression)
DoThis;
else
DoThat;
}
|