Advertisement
TheWhiteFang

Tutorial 4 Section A (a) [string length]

Nov 16th, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. // http://pastebin.com/u/TheWhiteFang
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8.  
  9.     string name;
  10.    
  11.  
  12.     cout << "Please enter a string:\n";
  13.     getline(cin, name);
  14.     cout << endl;
  15.  
  16.  
  17.     cout <<"Your entered string is: "<< name <<" and the length is "<< name.length() << endl <<endl;
  18.  
  19.     return 0;
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement