1 2 3 4 5 6 0
2 3 4 5 6 0
|
|
|
|
|
|
Error C4700 uninitialized local variable 'l' used
. What is it? Isn't l is a way to get access to the linked list?Isn't l is a way to get access to the linked list? |
l
is a LinkedList object that you do create on line 32.l
has nothing to do with LinkedList object lst
that you did create on line 5.
|
|
Isn't l is a way to get access to the linked list? |
l
is an uninitialized list without valid data. You want to use lst
which contains the data you are looking for.head
is a null. Thus there is no data connected to it and since you do not check for null line 37 will crash/is undefined behavior. You need to use lst.head
where the data is actually connected to.
2 3 4 5 6
. I found out the problem is for the while (x!=0)
. Since this file is just integers, do I have to use getline to read the whole of them?