Guest User

Untitled

a guest
Dec 17th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3.  
  4. using std::string;
  5. using std::cout;
  6. using std::endl;
  7.  
  8. int main()
  9. {
  10. string str("ololo");
  11.  
  12. cout << str << endl;
  13.  
  14. char *chrStr = new char [str.length() + 1];
  15. memcpy (chrStr, str.c_str(), str.size());
  16. chrStr [str.size()] = 0;
  17.  
  18. cout << chrStr << endl;
  19. }
Add Comment
Please, Sign In to add comment