Timeline for Simple program to insert values in a linked list
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 24, 2016 at 18:25 | history | edited | 200_success | CC BY-SA 3.0 |
deleted 12 characters in body; edited title
|
Jun 24, 2016 at 18:06 | history | migrated | from stackoverflow.com (revisions) | ||
Jun 24, 2016 at 14:37 | comment | added | Cherubim Anand |
ya @JonathanLeffler I did notice that :) , anyway the OP is again assigning the value of i with the same value that it already has
|
|
Jun 24, 2016 at 14:32 | comment | added | Jonathan Leffler |
@CherubimAnand: I agree with you, but the funny thing is that in the context, the assignment works. The previous if clause takes care of the cases where i is not already N-1 . The assignment is wrong; it should be a comparison — or, in fact, it should be just an else not an else if so the comparison isn't needed.
|
|
Jun 24, 2016 at 14:16 | vote | accept | Giorgio M. | ||
Jun 24, 2016 at 13:58 | answer | added | Cherubim | timeline score: 3 | |
Jun 24, 2016 at 13:49 | comment | added | Cherubim Anand |
make else if (i=N-1) to else if (i==N-1)
|
|
Jun 24, 2016 at 13:44 | comment | added | MikeCAT | The input part should be merged into one set of code, not two like copied and pasted. | |
Jun 24, 2016 at 13:44 | comment | added | MikeCAT |
I suggest you should format your code properly. Also the assignment i=N-1 seems meaningless, so I think the if statement should be removed and it should be a simple else clause.
|
|
Jun 24, 2016 at 13:42 | history | asked | Giorgio M. | CC BY-SA 3.0 |