This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
cs-142:more-data-types-work [2016/09/10 15:22] kseppi |
cs-142:more-data-types-work [2016/09/10 15:35] kseppi |
||
---|---|---|---|
Line 24: | Line 24: | ||
string fullName = firstName + " " + lastName; | string fullName = firstName + " " + lastName; | ||
cout << "my full name is " << fullName << endl; | cout << "my full name is " << fullName << endl; | ||
+ | // Remember that this works: | ||
+ | cout << "Some sum! " << 23 + 34 << endl; | ||
+ | // But this will not: | ||
+ | // cout << "Failed Concatination: " << "some"+"more" << endl; | ||
+ | |||
// string can be tell us more than just their contents: | // string can be tell us more than just their contents: | ||
int nameLength = fullName.length(); | int nameLength = fullName.length(); |