Advertisement
Felanpro

string functions fun

May 27th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <string> //For string functions.
  3. #include <stdlib.h> //For system()
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     string x;
  10.     x.append("lol");
  11.     cout << x << endl;
  12.  
  13.     string y;
  14.     y.append("Hey");
  15.     cout << y << endl;
  16.     system("pause");
  17.     system("cls");
  18.     y.erase(1);
  19.     cout << y << endl;
  20.  
  21.     string z;
  22.     z.append("Hello");
  23.     cout << z.at(3) << endl;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement