fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string foo;
  6.  
  7. cout << "Enter some random text: ";
  8. getline(cin, foo);
  9.  
  10. size_t sz = foo.size();
  11. size_t sz2 = foo.length();
  12.  
  13. cout << foo << endl;
  14. cout << sz << endl;
  15. cout << sz2 << endl;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 3476KB
stdin
aa bbb cccc
stdout
Enter some random text: aa bbb cccc
11
11