S
STF
While reading the C++ tutorial in this page:
http://www.cplusplus.com/doc/tutorial/tut2-2.html
I'm astonished to learn that we could omit curly brackets in function
declaration for single instruction as is written in the paragraph:
"statement is the function's body. It can be a single instruction or a
block of instructions. In the latter case it must be delimited by curly
brackets {}."
But I'm not sure if this is true. At least with GCC under Linux
and MinGW used within Dev-C++ for Windows, I'm unable to compile a file
having something like this:
int test123(int a)
return a;
So, could someone tell me if what's written in that webpage is
correct or not.
TIA
STF
http://www.cplusplus.com/doc/tutorial/tut2-2.html
I'm astonished to learn that we could omit curly brackets in function
declaration for single instruction as is written in the paragraph:
"statement is the function's body. It can be a single instruction or a
block of instructions. In the latter case it must be delimited by curly
brackets {}."
But I'm not sure if this is true. At least with GCC under Linux
and MinGW used within Dev-C++ for Windows, I'm unable to compile a file
having something like this:
int test123(int a)
return a;
So, could someone tell me if what's written in that webpage is
correct or not.
TIA
STF