fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. #include <string.h>
  4. using namespace std;
  5.  
  6. int main() {
  7. string s(10,' ');
  8. strcpy((char*)s.data(),"Hello");
  9. cout << s << endl;
  10. cout << s.length() << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 4540KB
stdin
Standard input is empty
stdout
Hello    
10