0
私はまだC++プログラミングに関するハンドルを取得しようとしています。異なる人物オブジェクトを作成し、ツリーを使用してその人物にブックタイトルを保存するコードをコンパイルしようとしています。私insert()
機能にC++の関数への未確認の参照
')search_Book(' ')insert_Book(' へ
正体不明の参照をする
正体不明参照:私は入れません。どうしてこれなの?ありがとうございました!
//insert function void insert(){ char ch; cout << endl << "@Insertion module..............."; do { sub_menu(); cin >> ch; ch = tolower(ch); switch(ch) { case 'p': if(insert_personnel() != 0) cout << "@INSERTION OPERATION FAILED." << endl; else cout << "@INSERTED SUCCESSFULLY." << endl; break; case 'e': if(insert_employee() != 0) cout << "@INSERTION OPERATION FAILED." << endl; else cout << "@INSERTED SUCCESSFULLY." << endl; break; case 'f': if(insert_faculty() != 0) cout << "@INSERTION OPERATION FAILED." << endl; else cout << "@INSERTED SUCCESSFULLY." << endl; break; case 's': if(insert_student() !=0) cout << "@INSERTION OPERATION FAILED." << endl; else cout <<"@INSERTED SUCCESSFULLY." << endl; break; case 'b': if(insert_Book() !=0) cout << "@INSERTION OPERATION FAILED." << endl; else cout <<"@INSERTED SUCCESSFULLY." << endl; break; case 'g': if (search_Book() !=0) cout << "@INSERTION OPERATION FAILED." << endl; else cout <<"@INSERTED SUCCESSFULLY." << endl; break; case 'q': cout << endl << "@Exiting the insertion..." << endl; cin.get(); break; default: cout << endl << "@ERROR - Invalid input." << endl; cout << "@Try again....." << endl; } } while (ch != 'q'); } int search_Book(Book *root,char *ntitle){ if (root == NULL){ cout<<"No Books found"; return -1; } else if(ntitle == root->title){ cout<<"Title:\t"<<root->title<<endl<<"URL:\t"<<root->url<<endl; return 0; } else if(ntitle[0] < root->title[0]){ return search_Book(root->left,ntitle); } else { return search_Book(root->right,ntitle); } } int insert_Book(){ char name[50]; char title[100]; char url[100]; Student* node; cout<<"Enter the name of the student you want the book to be added to: "; cin>>name; node = searchstudent(name); if(node == NULL){ return 1; } else{ cout<<"Enter the Title: "; cin>>title; cout<<"Enter the url: "; cin>>url; add_Book(node->bookTree,title,url); return 0; } }