link list in c++

Upload: irfanchandmian

Post on 08-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 Link List in c++

    1/3

  • 8/7/2019 Link List in c++

    2/3

    char what='y';while(what=='y'){

    coutsptr->name;coutsptr->Rno;

    sptr->next=0;coutwhat;if(what=='y'){

    sptr->next=new student;sptr=sptr->next;

    }}

    }void traverse(student *sptr){

    char cond;clrscr();coutcond;while(sptr!=0){

    cout

  • 8/7/2019 Link List in c++

    3/3

    coutitem.name>>position;int point=1;student *ptr;ptr=&item;while(pointnext=sptr->next;ptr=sptr->next;

    }sptr=sptr->next;point++;

    }}void Del(student *sptr){

    int position,point=1;

    coutposition;student *ptr;while(pointnext=sptr->next;}ptr=sptr;sptr=sptr->next;

    }}