![]() |
Connecting link lists
Hello, I want to make a linked list program consisting of one main link, and each main links have sub link like
Code:
Main 1 -> Main 2 -> Main 3 -> ... -> Main N -> NULLCode:
struct NodeSmallCode:
int main()It does not give compiler error (vs2008) but it gives stopped working error after running the program. I think I've made a mistake while connecting link lists together. But I cannot find similar probles on internet. What should I do for fixing this error? Thank you. |
Re: Connecting link lists
head->docNum->documentNum = number;
is not valid because docNum is not assigned anything. Have you checked if your file exists and it reads the number into the variables fine. |
Re: Connecting link lists
I've found the error.
I should have used Code:
head->docNum = new NodeSmall;Code:
NodeSmall *docNum = new NodeSmall; |
| All times are GMT +5.5. The time now is 09:39. |