0

c++ error says deleteCourse was not declared in the scope

#include <iostream> #include <string> using namespace std; struct courseInfo{ string courseName; string courseGrade; struct courseInfo *next; }; struct studentData{ string firstName; string lastName; int admNo; string grade; struct studentData *next; }; struct staffData { string firstName; string lastName; string exp; string phone; struct staffData *next; }; struct courseInfo *insertCourse(struct courseInfo *root){ struct courseInfo *temp = new struct courseInfo; cout<<"Enter the name of the course: "<<endl; cin>>temp->courseName; cout<<"Enter the grade of the course: "<<endl; cin>>temp->courseGrade; temp->next=NULL; if(root==NULL) root=temp; else temp->next=root; root=temp; cout<<endl; return root; } struct studentData *insertStudent(struct studentData *root){ struct studentData *temp = new struct studentData; cout<<"Enter the first name of student: "<<endl; cin>>temp->firstName; cout<<"Enter the last name of student: "<<endl; cin>>temp->lastName; cout<<"Enter admission no: "<<endl; cin>>temp->admNo; temp->next=NULL; if(root==NULL) root=temp; else temp->next=root; root=temp; cout<<endl; return root; } struct staffData *insertStaff(struct staffData *root){ struct staffData *temp = new struct staffData; cout<<"Enter the first name of staff: "<<endl; cin>>temp->firstName; cout<<"Enter the last name of staff: "<<endl; cin>>temp->lastName; cout<<"Enter the staff phone number: "<<endl; cin>>temp->phone; temp->next=NULL; if(root==NULL) root=temp; else temp->next=root; root=temp; cout<<endl; return root; } void deleteCourseIbfo(struct courseInfo *root){ string courseName; struct courseInfo *temp=NULL; struct courseInfo *prevTemp=NULL; cout<<"Enter the name of the course you want to delete: "; cin>>courseName; while(root!=NULL){ if(root->courseName==courseName){ temp=root; break; } else{ prevTemp=root; root=root->next; } } pr

1st Dec 2018, 10:19 AM
harry potter
2 Answers
+ 8
Better save that code in your profile and attach the link on the original question. The limits on characters had cropped your text, and you end up having to write more on the "Answers" section, which risk to confuse others thinking you have had an answer and refrain from answering. In case you didn't know how; ● Go to your profile → Codes section Create new code, and save it. ● In code editor, copy URL from address bar if you're on web browser. If you're on mobile app tap on Share button on top right of code editor → Copy to clipboard ● Edit your original post, delete the cropped code text, paste the URL. ● Delete your answer, I will then also delete this note as I see you update the post with code attached. May you find your solution.
1st Dec 2018, 10:39 AM
Ipang
0
need your help
1st Dec 2018, 10:19 AM
harry potter