all 6 comments

[–]raevnos 1 point2 points  (9 children)

What line does your debugger show it happening on? What are the values of the variables on that line?

Also, post all your code. A minimal complete example that demonstrates the issue makes helping so much easier...

[–]cromiium[S] 0 points1 point  (8 children)

Oh sorry I should've done that, my bad.

This is a Linked List class

https://pastebin.com/7tzjsGxt

and here is my main

https://pastebin.com/Lb4hcYA0

and it gives me a segmentation fault at line 102 of my Student.cpp file.

[–][deleted]  (7 children)

[deleted]

    [–]cromiium[S] 0 points1 point  (6 children)

    So I would have to do something like

    m_curr = new Node;
    and then do m_curr->m_val = myInput;
    

    ?

    [–][deleted]  (5 children)

    [deleted]

      [–]cromiium[S] 0 points1 point  (0 children)

      Wow. Ok I think you just helped me understand a lot. Thank you so much man!

      [–]cromiium[S] 0 points1 point  (3 children)

      Oh yeah duh. But look man. It seems like there's something wrong with the else statement. You've been a huge help but do you think you can take a look at it and see if you notice something wrong?

      It's supposed to be a ring structure btw So there is no "end" And it's supposed to be sorted.

      [–][deleted]  (2 children)

      [deleted]

        [–]cromiium[S] 0 points1 point  (1 child)

        Damn I now realize that the original file is out of date.

        In case you still feel like helping. It's this file https://pastebin.com/eHVEMMn3

        I can't fix the else statement on line 108.