fork download
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. char arr[128] = "";
  9.  
  10. for(int len = 0, c = getch();
  11. !(c == ' ' || c == '\n' || c == '\r') && len < 127;
  12. ++len, c = getch())
  13. {
  14. cout << (arr[len] = c);
  15. }
  16.  
  17. cout << endl;
  18.  
  19. cout << arr << endl;
  20.  
  21. return 0;
  22. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty