I have been trying to make a linked list, but it wont print out properly with cout.
The output of the program when compiled with code blocks is
10
The program fails to compile with Dev-c++
The output I expect is
1
2
3
4
5
6
7
8
9
10
I have tried debugging the program and the loop doesn't seem to run properly. The variable "i" seems to go to 10 without first going through the numbers 1-9.
I was wrong when I said it wouldn't compile with Dev-C++. It would compile, but give an error when I ran it. This was fixed by making addnumber return ptemp.
I also removed the <cstlib> header file. Somehow now it magically works.