Sorry but i can't figure out what you are trying to do. The whole thing is primitive. Why not use std::list and not worry about the design of the linked list itself? http://cplusplus.com/reference/stl/list/
if you really want to make your own singly linked list I suggest that you create a really simple template class that works with integers first and get that working. Once you have a template class in place it ought to work with any other type. I also suggest that you do a web search. There are many linked list examples. The code that you posted is very confusing.
Sorry but i can't figure out what you are trying to do. The whole thing is primitive. Why not use std::list and not worry about the design of the linked list itself? http://cplusplus.com/reference/stl/list/
if you really want to make your own singly linked list I suggest that you create a really simple template class that works with integers first and get that working. Once you have a template class in place it ought to work with any other type. I also suggest that you do a web search. There are many linked list examples. The code that you posted is very confusing.
when I put second Doctor, Students take from the first Doctor
as,
I have no idea what that first statement means. Again - please state your requirements more clearly. What do you want a linked list of? students? Doctors? Both?
I have no idea what that first statement means. Again - please state your requirements more clearly. What do you want a linked list of? students? Doctors? Both?
I used 2 linked list.
First : Students.
Second: Doctor.
Every Doctor takes a set of his students.
as,
Doctor 1
===> Student 1
===> Student 2
Doctor 2
===> Student 3
===> Student 4
In this code:
when I put second Doctor, Students take from the first Doctor
as,
Doctor 1
===> Student 1
===> Student 2
Bookmarks