Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. while( true )
  2. {
  3. char opcje2;
  4. do
  5. {
  6. cout <<endl<<endl;
  7. cout << "Czy chcesz cos dopisac?"<<endl;
  8. cout <<"[1] Tak / [2] NIE\n" <<endl;
  9. opcje2 = getch();
  10. switch(opcje2)
  11. {
  12. case '1':
  13. {
  14. outfile.open (str.c_str(), ios::app);
  15. cout << "\nPodaj tekst ktory ma byc dopisany:\n";
  16.  
  17. cin.sync(); // czysci bufor strumienia wejsciowego
  18. getline(cin, textToAdd);
  19.  
  20. for(i=0; i<textToAdd.length(); i++)
  21. {
  22. outfile << textToAdd[i];
  23. }
  24. outfile.close();
  25. break;
  26. }
  27. case '2':
  28. {
  29. showMenu();
  30. break;
  31. }
  32. }
  33.  
  34. }
  35. while(opcje2 != '2');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement