Question #24738

Write a function to delete a node containing Book's information from a dynamically allocated stack of Books implemented with the help of the following structure.

struct BOOK{ int BNo; char BNAME[20]; BOOK*NEXT;};

Expert's answer

struct BOOK{ int BNo; char BNAME[20]; BOOK*NEXT;};

void deleteBook(BOOK &a){
//we delete next BOOK after BOOK a
a.NEXT = (a.NEXT)->NEXT;
}
LATEST TUTORIALS
APPROVED BY CLIENTS