Guest User

Untitled

a guest
Dec 4th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. char str[1000];
  2. int i = 0;
  3. n[i] = getchar();
  4. while (n[i] != 'n') {
  5. i++;
  6. n[i] = getchar();
  7. }
  8.  
  9. string s = str;
  10.  
  11. string s;
  12. getline(cin,s);
  13.  
  14. char str[1000] = { 0 };
  15. fgets(str,1000,stdin);
  16.  
  17. string s(str, i);
  18.  
  19. i++;
  20. str[i] = '';
  21. string s(str);
  22.  
  23. #include <iostream>
  24. #include <string>
  25.  
  26. int main(){
  27. char buf[] = "Hello, World!";
  28. std::string str;
  29. str = buf;
  30. std::cout << str << std::endl;
  31. return 0;
  32. }
Add Comment
Please, Sign In to add comment