'temp' is undeclared, first use this function. :     #include<iostream>
    #include<conio.h>
    #include<string>
    #include<cstring>
    #include<stdlib.h> 
    using namespace std;

    bool rgstr_stdnt(struct student *stud,struct list *ls);
    double calculate_aggregate(struct student *);
    void srch_student(struct student * next);
    void addToList(struct student *stud, struct list *l);
    void display(struct student *stud, struct list *l);

    struct student
    {
    char name[20];
    int matric_marks, inter_marks, aptitude_marks;
    int temp;
    student *next;
    };
    struct list
    {
    char name[20];
    double aggr;
    list *next;
    };
this is where the problem shows up, it says temp undeclared, first use this function and I'm not able to rectify it
    void srch_stdnt(struct student *stud)
    {
     
	char name[60];
    cout << "Enter Student to search :";
    cin>>name;
    cout << name;
down here, the error comes and whatever i knew, i have tried to solve it but could not
        while (temp!=NULL){
            if(strcmp(temp->name, name)==0){
                
            }
            temp = temp->next;
        }
        cout << "No match found";
        
     }


    int main()
    {   
    student * temp=new student();
    student *s;  
    s = (struct student *) malloc(sizeof(struct student));
    struct list *ls;
    ls = (struct list *) malloc(sizeof(struct list));
    strcpy(ls->name,"");
    ls->aggr = 0;
    ls->next= NULL;
    do
    {
    
    cout<<"                 STUDENT ENROLLMENT AND RECORDS MANAGEMENT"<<endl;
    
    
    cout<<"1- To Enroll A New Sudent."<<endl;
    cout<<"2- To View The Enrolled Students."<<endl;
    cout<<"3- To Search Through The Already Enrolled Students."<<endl;
    cout<<"4- Exit."<<endl;
    int input;
    cin>>input;
    if (input == 1)
    {
        rgstr_stdnt(s, ls);
    }
    else if (input == 2)
    {
        display(s, ls);
    }
    else if(input == 3)
    {
         void srch_student(struct student * stud);
     }
    else if (input == 4)
        exit(0);
    cout<<endl;
    } while(1);
    getch();
    }
    bool rgstr_stdnt(struct student *stud,struct list *ls)
    {   
    student *s = stud; 
    cout<<"Enter Name Of The Student: "<<endl;
    cin>>s->name;
    cout<<"Enter Percentage in 10th Grade: "<<endl;
    cin>>s->matric_marks;
    cout<<"Enter Intermediate Percentage:"<<endl;
    cin>>s->inter_marks;
    cout<<"Enter Percentage In Aptitude Test: "<<endl;
    cin>>s->aptitude_marks;
    double aggregate;
    aggregate = calculate_aggregate(s);  
    cout<<"Aggregate Percentage Is: "<< aggregate<<"%"<<endl;
    if (aggregate >= 70)
    {
        cout<<"-> Student Enrolled In BSCS. <-"<<endl;
        addToList(s,ls);
        return true;
    }
    else if (aggregate >= 60)
    {
        cout<<"-> Student Enrolled In BE. <-"<<endl;
        addToList(s,ls);
        return true;
    }
    else if (aggregate >=50)
    {
        cout<<"-> Student Enrolled In MS. <-"<<endl;
        addToList(s,ls);
        return true;
    }
    else
    {
        cout<<"Sorry, Low Percentage. Student Can't Be Enrolled!"<<endl;
        return false;
    }
    }


    double calculate_aggregate(struct student *stud)
    {   
    student *s = stud;
    double aggr;
    aggr = s->matric_marks * 10/100  + s->inter_marks * 50/100 + 
    s->aptitude_marks * 40/100;
    return aggr;
    }
    void addToList(struct student *stud, struct list *l)
    {   
    list *pointer = l;
    while (pointer->next != NULL)
    {
        pointer = pointer->next;
    } 
    pointer->next = (struct list *) malloc(sizeof(struct list));
    pointer = pointer->next;
    strcpy(pointer->name , stud->name);
    pointer->aggr = calculate_aggregate(stud);
    pointer->next = NULL;
    }
    void display(struct student *stud, struct list *l)
    {
    list *pointer = l;
    if (pointer->next == NULL)
        cout<<"No Students Enrolled Yet."<<endl;
    else
    {
        cout<<" !- - - - - - - - -.  STUDENTS RECORDS  .- - - - - - - - - -! " 
    <<endl;
        while (pointer->next != NULL)
        {
            pointer = pointer->next;
            cout<<"Name Of Student: "<<pointer->name<<endl;
            cout<<"Aggregate Is: "<<pointer->aggr<<endl;
            if (pointer->aggr >= 70)
                cout<<"-> Student Enrolled In BSCS. <-"<<endl;
            else if(pointer->aggr >=60)
                cout<<"-> Student Enrolled In BE. <-"<<endl;
            else
                cout<<"-> Student Enrolled In MS. <-"<<endl;
                cout<<endl;
            }
        }
     }
Any who could help me solve this, i'd really be grateful.