Skip to content

Commit

Permalink
String
Browse files Browse the repository at this point in the history
This program is used to learn the String class parameters used by the
function
  • Loading branch information
feihun1 committed Apr 1, 2017
1 parent 271aa87 commit 1c48e1f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cpp three.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//The String class parameters used by the function:
#include <iostream>
#include <string>
using namespace std;
void _stdout(string std[], int x);
int main()
{
const int a=5;
string sth[a]; //string **[] amount to 2 d array
cout << "please input string:" << endl;
for (int i = 0; i < a; i++)
{
cout << "please" << endl;
getline(cin, sth[i]);
}
cout << "your list:"<<endl;
_stdout(sth, a);
cin.get();
return 0;
}
void _stdout(string std[], int x)
{
for (int i = 0; i < x; i++)
{
cout << std[i] << endl;
}
cin.get();
}

0 comments on commit 1c48e1f

Please sign in to comment.