DEV Community

Discussion on: 9 C++ statements to kick off your C++ programming journey

Collapse
 
pauljlucas profile image
Paul J. Lucas

Every C++ program is written using commands.

No. They're correctly called "statements."

The #include command tells your preprocessor ...

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.

cout << "and all who inhabit it!";

You forgot the trailing \n.

Collapse
 
ericaeducative profile image
ericaeducative

Thank you so much for your feedback, Paul! We made some edits and think you'll find this more accurate now.

Collapse
 
pauljlucas profile image
Paul J. Lucas • Edited

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.