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