ENGR 101 Lecture 18: 18LectureNotes-2
Document Summary
So far we have considered problems where the data we are manipulating is primarily numbers. Often the data we want to work with is not number, but rather text. Strings provide a way of manipulating text objects to use strings you must include them by putting an include line at the top of your c++ program: Declaring a string to declare a string: string firstname; to assign a value to a string string firstname( peter ); string firstname= peter ; or. You could do the same thing in two steps string firstname; firstname = peter ; You can add strings together string firstname( peter ); string lastname( parker ); string fullname, occupation; full name = firstname + + lastname; occupation = superhero ; You can send strings to files and standard output using << cout << name: << fullname << endl; cout << job: << occupation << endl; Note, however that upper and lowercase letters are considered different.