Posts

Showing posts from March, 2016

Linked List--Menu

Well, here is example of Linked List for Student record... #include <conio.h> #include <iostream.h> #include <malloc.h> #include <stddef.h> #include <string.h> #include <stdio.h> struct List{     int NIM;     char Nama[20];     float IPK;     List *Next;     }; List *Head, *Baru, *PNow, *PAkhir, *HNow, *HBfr; int Pilih; int main() {  Head = new(List);  Head -> Next = NULL;  do  {   //clrscr();   cout<<"\n*************************\n";   cout<<"*  M E N U   U T A M A           *\n";   cout<<"* 1. Add Data (di akhir)         *\n";   cout<<"* 2. Add Data (di awal)          *\n";         cout<<"* 3. View Data                   *\n";   cout<<"* 4. Search Data                 *\n";   cout<<"* 5. Delete Data                 *\n";   cout<<"* 6. Min & Max Value             *\n";   cout<<"* 7. Exit