[Solved] Inserting at the end of linked list. Why S node becoming null at each insertion
[ad_1] s is null after every insertion because your code s = newnode is setting the local s pointer to a new value, which does not updated the contents of the original pointer in main(). You could either have insertnode() return the s pointer (e.g., s = insertnode(s,5), not recommended), or have main() create a … Read more