Things like #include, #define, etc., are not really part of C++ proper, but instead are directives (also not commands) of the C preprocessor. You also haven't explained to the reader what a "preprocessor" is.
No semicolon is needed after a #define statement.
While that's true, you didn't mention that, if you do include a semicolon, it's included as part of the replacement text — which most often isn't what you want (but sometimes can be).
The using command tells your compiler to bring a specified member into a current scope ...
You haven't explained to the reader what a "scope" is.
Defining the main function requires setting parameters within the parentheses.
No. You declare (not "set") parameters within the parentheses.
No semicolon is needed after function definition.
No. It's not that it's not "needed" (which implies it's optional); it's actually wrong to put it.
The cout command ...
No. cout is a global object declared and defined as part of the C++ standard iostreams library.
Well, it's marginally better, but you still don't explain what a scope is; and cin and cout still aren't statements; and you're still missing the newline after it! (which means on CLI systems, the shell's prompt will appear immediately after the !).
I also wouldn't discuss #define early on since C++ has largely replaced all uses of what C used #define for.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
No. They're correctly called "statements."
Things like
#include
,#define
, etc., are not really part of C++ proper, but instead are directives (also not commands) of the C preprocessor. You also haven't explained to the reader what a "preprocessor" is.While that's true, you didn't mention that, if you do include a semicolon, it's included as part of the replacement text — which most often isn't what you want (but sometimes can be).
You haven't explained to the reader what a "scope" is.
No. You declare (not "set") parameters within the parentheses.
No. It's not that it's not "needed" (which implies it's optional); it's actually wrong to put it.
No.
cout
is a global object declared and defined as part of the C++ standard iostreams library.You forgot the trailing
\n
.Thank you so much for your feedback, Paul! We made some edits and think you'll find this more accurate now.
Well, it's marginally better, but you still don't explain what a scope is; and
cin
andcout
still aren't statements; and you're still missing the newline afterit!
(which means on CLI systems, the shell's prompt will appear immediately after the!
).I also wouldn't discuss
#define
early on since C++ has largely replaced all uses of what C used#define
for.