Guest User

Untitled

a guest
Jun 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. string Hrac::dopln(string slovo){
  2. string odpoved="";
  3. ofstream out(m_slova.c_str(),ios_base::app);ifstream in(m_slova.c_str());
  4. if (out.is_open(),in.is_open()){
  5. string moznaOdpoved = "";
  6. bool nalezeno = false;
  7.  
  8. while ((in >> moznaOdpoved) and (nalezeno==false) ){
  9. if (moznaOdpoved == slovo){
  10. nalezeno = true;
  11. cout << "Toto slovo uz ve slovniku je" << endl;
  12. out.close();
  13. }
  14. }
  15. out << slovo << endl;
  16. in.close();
  17. } else {
  18. cerr << "Nelze otevrit soubor slov pro doplneni" << endl;
  19. }
  20. return odpoved;
  21. }
Add Comment
Please, Sign In to add comment