|
|
|
|
Is that the first one creates and overwrite Node repeatedly in stack, so it caused problems? |
next
doesn't make sense.Node
will become invalid after the loop ends und will be overwritten by other data on the stack. That will cause undefined behavior and will likely lead to crash [some time later].