Sometimes you want to keep a note in the source without showing it to the person reading the program's output. A comment is source text that the compiler ignores.
// starts a comment that continues to the end of that source line. It can occupy a line on its own or follow a statement:
#include <iostream>
int main() {
// This notice belongs at the entrance.
std::cout << "Please sign in" << "\n"; // A visible message
return 0;
}
Only Please sign in appears in the Console. The notes do not need quotes because they are comments, not string literals. C++ also supports comments between /* and */, which can span lines. Use short // notes here; they make it clear which line is being discussed.
A commented-out statement does not execute. Removing its leading // turns it back into code, provided the remaining text is a complete valid statement. This is useful while preparing a notice, but do not remove // from ordinary English notes: English is not automatically C++.
Blank lines and indentation outside quoted strings help organize source. They do not add spaces or blank lines to the output. The spaces inside "Collect name tags", on the other hand, are part of the message.
The starter has an English note, a TODO pointing to your edit, and a prepared output statement that begins with //. Remove // only from the line containing std::cout. The English note and TODO remain comments; the output statement becomes active code. Keep its quotes and semicolon.
// from the prepared output statement so it prints Collect name tags.Edit main.cpp, press Run to inspect the Console, then Submit to check these results.