Note 2.1.1.
In C++, strings are declared as type
string
. We’ll explain what that means in the next few pages.
main
. For example, to output more than one line:
endl
.string
. We’ll explain what that means in the next few pages.
endl
:
Goodbye, cruel world!
. Notice in main
that there is a space between “Goodbye,” and the second quotation mark. This space appears in the output, so it affects the behavior of the program.
#include <iostream>
using namespace std;
int main() {
cout << 7 << endl;
cout << 7;
cout << 7;
cout << 7;
}