fork(3) download
  1. #include <iostream> /// cin, cout
  2.  
  3. using namespace std;
  4.  
  5. /// test the get(c) stream member function
  6. void get0()
  7. {
  8. char c;
  9.  
  10. cout << "Please type some characters: ";
  11. cin.get(c);
  12.  
  13. cout << "the 1st "
  14. << " character typed: "
  15. << c << endl << endl;
  16. }
  17.  
  18.  
  19. int main()
  20. {
  21. get0();
  22. }
Success #stdin #stdout 0s 16064KB
stdin
ktyr
stdout
Please type some characters: the 1st  character typed: k