11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7: Storing Sequences in Arrays 107// StringConcatenate - concatenate two string type// variables with a “ - “ in the middle#include #include #include #include using namespace std;int main(int nNumberofArgs, char* pszArgs[]){// read first string...string string1;cout > string1;// ...now the second string...string string2;cout > string2;// accumulate both strings into a single bufferstring buffer;string divider = “ - “;buffer = string1 + divider + string2;// ...and display the resultcout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!