I am new to c++ , trying to write singly linked list in c++ , and it's various operations like , print, insert at the end, insert the end, delete etc. I am doing step by step. I have written my first insert method. It is working fine no error , but the first time it goes to the if condition of insert i.e the list is empty and create the first node here the problem is coming is after entering the first node the output screen is closing saying "project has stopped working" . what I am trying to do is after entering one node it should ask "do u wish to add another node?" if users enter "y" it should continue otherwise should go back to main function : Here is my code :
thanks a lot . It's working fine now... :) but now having another problem with print after inserting if I enter a choice to print, no output screen is coming.
thanks again :) but even after modifying the code in print, the result is same. i am not sure if it's printing anything or not but the output screen is not staying, it's disappearing :(
@jaybob66
I got my solution , it was happening due to a silly mistake of mine... i forgot to put a break in switch function in main after calling the print function... thanks a lot for your help :)