My code is pretty straight-forward so I'm not sure why it isn't working, but basically my printList function locks up at soon as it calls my get functions. What wrong with them?
Your get() function fails to return any value if index = 0 or size-1. This may be causing the failure since index = 0 is the 1st case handled in your printList() function.
You can fix it easily. Instead of
1 2
}elseif(index == 0){
getFirst();// return value not used here
Just return the value given by getFirst().
1 2
}elseif(index == 0){
return getFirst();
Likewise for the getLast() case.
Don't ignore compiler warnings, such as "not all control paths return a value". That's the problem here.
Sweet, that's it.
And yeah, I know I shouldn't ignore warning, and I didn't, it's just that Dev C++ is old and crappy and I have to use it for my class. At any rate, making stupid mistakes like these and not having an automatic fix on hand has been hugely useful in improving my code, so I'm kinda reluctant to switch to a better compiler until I no longer need to use this one.