Hey, this little program I wrote keep crashing. I posted this already in the beginner forum but noone's come up with anything. Here's a copypasta of the original post.
Howdy,
This little program I've written for my class keeps crashing when trying to output elements of the list. Below is the code, with a comment at the point which is causing it to crash. Any ideas? I haven't been able to figure this one out. Thanks ^_^
I don't understand why you are using pop_back at all. You just need to figure out where to insert each new string. You shouldn't be deleting anything within the list. lower_bound will help you determine that. All you need to do is determine the insertion point and insert each string. Or you can follow the advice in the other thread and use list::sort when finished inserting all. This is really very simple.
maybe i should have been clearer on the objective of this assignment. I need to sort each entry as it is entered, not after they have all been entered.
the intention of using pop_back was to eliminate empty elements of the list, because as i understood the list needs to be initialized somehow so i used empty characters.