Jump to content

Hey guys, I'm trying to add to a linear linked list within linear linked lists and I'm getting a seg fault not when I call the function,

but when I say help= new assistance(my arguments), and I have no idea why.  I have attached the code so you can help

properly, but I'm not sure what is happening. Any help is appreciated. The seg fault seems to be happening at line 59 in tutormain.cpp

tutor.cpp

tutor.h

tutormain.cpp

i5 4670k| Asrock H81M-ITX| EVGA Nex 650g| WD Black 500Gb| H100 with SP120s| ASUS Matrix 7970 Platinum (just sold)| Patriot Venom 1600Mhz 8Gb| Bitfenix Prodigy. Build log in progress 

Build Log here: http://linustechtips.com/main/topic/119926-yin-yang-prodigy-update-2-26-14/

Link to comment
https://linustechtips.com/topic/685905-seg-fault-from-using-new/
Share on other sites

Link to post
Share on other sites

You keep breaking basic c++ best practices rules and running into trouble because of it, all the while ignoring advice I tried to give in previous posts. How long are you going to keep stumbling about like this ?

 

Once again from the top:

-Learn const correctness.

-Never have a class manage more then 1 resource.

-No naked new. use RAII to wrap them (std::unique_ptr)...

-Rule of three...

 

For starters...

 

Link to comment
https://linustechtips.com/topic/685905-seg-fault-from-using-new/#findComment-8809286
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×