Jump to content

Linear Linked List help

Go to solution Solved by CJPowell27,

Update: i threw in come random code and it worked so I guess this is solved

Hey guys, I've been trying to add a node right after the first node in a linear linked list.  

However, I've been getting a seg fault from the code and I have no idea what to do, here

is my code.  Any help is appreciated, thank you so much.

http://imgur.com/nXICuuN

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/565509-linear-linked-list-help/
Share on other sites

Link to post
Share on other sites

It is C++, I'm not sure how to do the code tags, would it help to upload to pastebin?

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/565509-linear-linked-list-help/#findComment-7432041
Share on other sites

Link to post
Share on other sites

3 hours ago, CJPowell27 said:

It is C++, I'm not sure how to do the code tags, would it help to upload to pastebin?

You can add code tags in your post like this.

[code]
// Write code here
[/code]

There's also a <> icon above where you post (between the quote and spoiler options) that you can use to add it as well. When posting long pieces of code it's nice to wrap spoiler tags around it or link to another site. Pastebin, gist, and other similar sites are fine as well.

 

It allows people to copy/paste and run the code which can help with debugging and solving problems.

Link to comment
https://linustechtips.com/topic/565509-linear-linked-list-help/#findComment-7433178
Share on other sites

Link to post
Share on other sites

Update: i threw in come random code and it worked so I guess this is solved

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/565509-linear-linked-list-help/#findComment-7433225
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

×