HomeworkAssignment4 - remove those pesky end-of-lines...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 // Homework #4 CSE 1020.301 Kasey Scott [email protected] #include <iostream> int main () { int len1, len2, len3 string firstLine, secondLine, thirdLine cout << "Homework Assignment 4\t CSE 1020.301" << endl << "Kasey Scott \t [email protected]" << endl cout << "Please enter a string." << endl cin >> firstLine cout << "Please enter another string" << endl cin >> secondLine while (getline(cin, firstLine)) { // read first line getline(cin, secondLine)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // remove those pesky end-of-lines. thirdLine = firstLine + secondLine cout << "First line:" << firstLine << " has length " << firstLine.length() << endl cout << "Second line:" << secondLine << " has length " << secondLine.length() << endl cout << "Third line:" << thirdLine << " has length " << thirdLine.length() << endl // input word, etc. here } // end while getline return 0 } Sheet1 Page 2 // read second line // create third string...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

HomeworkAssignment4 - remove those pesky end-of-lines...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online