Linked List Problem

N

Niks

Hey..
I tried to creat a linked list by using a structure defined in a class
as follows:

class LL
{
struct node
{
int data;
node *next,*previous

}*head,*tail;
};


(This is not exactly the node that I have.Its a bit bigger.)
On this I wrote the fucntions such as add nodes, delete nodes etc.
Now the problem is that after creating some nodes, the TC compiler
stops abruptly and exits to windows.
The number of nodes after which this happens is not fixed.
The maximum number of nodes that i was able to creat was 13 and once i
could creat only 2 nodes .... on the third one it stopped.

Please help me....
Thanks for reading.
 
J

Jim Langston

Niks said:
Hey..
I tried to creat a linked list by using a structure defined in a class
as follows:

class LL
{
struct node
{
int data;
node *next,*previous

}*head,*tail;
};


(This is not exactly the node that I have.Its a bit bigger.)
On this I wrote the fucntions such as add nodes, delete nodes etc.
Now the problem is that after creating some nodes, the TC compiler
stops abruptly and exits to windows.
The number of nodes after which this happens is not fixed.
The maximum number of nodes that i was able to creat was 13 and once i
could creat only 2 nodes .... on the third one it stopped.

Please help me....
Thanks for reading.

You need to show us the code you are using to create the nodes.
 
C

Chris Theis

Niks said:
Hey..
I tried to creat a linked list by using a structure defined in a class
as follows:

class LL
{
struct node
{
int data;
node *next,*previous

}*head,*tail;
};


(This is not exactly the node that I have.Its a bit bigger.)
On this I wrote the fucntions such as add nodes, delete nodes etc.
Now the problem is that after creating some nodes, the TC compiler
stops abruptly and exits to windows.
The number of nodes after which this happens is not fixed.
The maximum number of nodes that i was able to creat was 13 and once i
could creat only 2 nodes .... on the third one it stopped.

Please help me....
Thanks for reading.

Well, the problem is not your list structure but rather the way that you
manage your list. You'll have to supply some code which illustrates the
actual problem.

Cheers
Chris
 
J

Jaspreet

Niks said:
Hey..
I tried to creat a linked list by using a structure defined in a class
as follows:

class LL
{
struct node
{
int data;
node *next,*previous

}*head,*tail;
};


(This is not exactly the node that I have.Its a bit bigger.)
On this I wrote the fucntions such as add nodes, delete nodes etc.
Now the problem is that after creating some nodes, the TC compiler
stops abruptly and exits to windows.
The number of nodes after which this happens is not fixed.
The maximum number of nodes that i was able to creat was 13 and once i
could creat only 2 nodes .... on the third one it stopped.

Please help me....
Thanks for reading.

You should need to move to an actual compiler faw away from TC. You
could look at one from :
http://www.thefreecountry.com/compilers/cpp.shtml

Also you would need to show us code to let someone to solve your
problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top