Selasa, 06 Juli 2010

Membuat program C++ Bag-2 (Menambah, Menghapus, mencari dan Menyimpan data)

#include<iostream.h> #include <conio.h> #include <stdio.h> #include <stdlib.h> struct TNode{ char data[30]; TNode *next; TNode *prev; }; TNode *head, *tail; void init(){ head = NULL; tail = NULL; }; int isEmpty(){ if(tail == NULL) return 1; else return 0; } void insertDepan(char databaru[30]){ TNode *baru; int i; baru = new TNode; for(i=0;i<=30;i++){ baru->data[i] = databaru[i]; } baru->next = baru; if(isEmpty()==1){ head=baru; tail=baru; head->next...