fork(1) download
  1. //Simple loop
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. string UserInput(string);
  8.  
  9. int main(void)
  10. {
  11.  
  12. string input;
  13.  
  14. // Enter user input
  15. cout << "Enter your input: ";
  16. cin >> input;
  17.  
  18. // Display user input
  19. cout << "You entered: " << UserInput(input) << endl;
  20. return 0;
  21. /*while (number <= 5)
  22. {
  23. cout << "Enter your input: ";
  24. number++;
  25. }*/
  26. }
  27.  
  28. string UserInput(string)
  29. {
  30. //string Input =
  31. return 0;
  32. }
Runtime error #stdin #stdout #stderr 0s 3460KB
stdin
Standard input is empty
stdout
Enter your input: 
stderr
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid