fork download
  1. void CBinaryTree::Save()
  2. {
  3. SaveWord(root);
  4. }
  5.  
  6. void CBinaryTree::SaveWord(Node* root)
  7. {
  8. ofstream fout(fileName);
  9.  
  10. if (root->left != nullptr)
  11. {
  12. SaveWord(root->left);
  13. }
  14.  
  15. fout << root->english << " " << root->translation << endl;
  16.  
  17. if (root->right != nullptr)
  18. {
  19. SaveWord(root->right);
  20. }
  21.  
  22. fout.close();
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:6: error: 'CBinaryTree' has not been declared
 void CBinaryTree::Save()
      ^
prog.cpp: In function 'void Save()':
prog.cpp:3:11: error: 'root' was not declared in this scope
  SaveWord(root);
           ^
prog.cpp:3:15: error: 'SaveWord' was not declared in this scope
  SaveWord(root);
               ^
prog.cpp: At global scope:
prog.cpp:6:6: error: 'CBinaryTree' has not been declared
 void CBinaryTree::SaveWord(Node* root)
      ^
prog.cpp:6:28: error: variable or field 'SaveWord' declared void
 void CBinaryTree::SaveWord(Node* root)
                            ^
prog.cpp:6:28: error: 'Node' was not declared in this scope
prog.cpp:6:34: error: 'root' was not declared in this scope
 void CBinaryTree::SaveWord(Node* root)
                                  ^
stdout
Standard output is empty