But I ran it and it didn't do anything. So, I decided to run it
with this website: https://www.onlinegdb.com/online_c++_compiler
and it said "Segmentation Fault" or something like that. I can't
figure out why. Please help! :P
Did you use a debugger? If you haven't then learn how, it will save you hours of staring at code. That's what experienced coders do, before running down the hall yelling heeeeelp!
Have you done anything else to see what the problem is?
Have you tried rubber duck debugging?
1. Acquire a small rubber duck;
2. Verbally explain the problem to the duck, as if the duck was you boss;
3. The answer will become apparent.
Start by explaining to the duck what a linked list is.
A small thing (your problem is bigger) Don't use NULL, use nullptr instead.
I have used nullptr but I researched and could not find a difference...
Also, I don't know how to use a debugger, the one on VS2019 just
tells me why the program crashed but nothing else... I want to know
a more exact version of what the program is actually doing. Know any
good debuggers?
Also, I don't know how to use a debugger, the one on VS2019 just
tells me why the program crashed but nothing else...
The idea of a debugger is to create a watchlist of variables, step through the code 1 line at a time, keep an eye on the values, deduce where the problem is. If it segfaults, then see what is happening on the line that segfaults, work back from there. All the debuggers do this. VS debugger is apparently very good from what I have heard.
Start by explaining to the duck what a linked list is.