Advertisement
193030

String array

Mar 31st, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. #include <sstream>      // std::stringstream
  5.  
  6. using namespace std;
  7.  
  8.  
  9.  
  10. string input;
  11.  
  12. int main() {
  13.  
  14.  
  15.    string stringArray[10] = {};
  16.    for(int i =0; i<=5; i++)
  17.    {
  18.     getline(cin, input);
  19.     stringArray[i]= input;
  20.    }
  21.  
  22.    for(int i = 0; i<=5; i++)
  23.     cout << stringArray[i] << endl;
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement