Question: I have a programming problem I have been working on all day, and I have posted questions on forums with nothing but negative results and
I have a programming problem I have been working on all day, and I have posted questions on forums with nothing but negative results and comments from others. Yes, I am still new to C++ and I am doing my best to learn the material and apply it in a way that not only works, but makes sense. That being said it is most likely my unfamiliarity with C++ that has led to my problem (according to those that commented on my forum posts). Everything in my program is operating perfectly except for one function. The "swap2" function in my Course_Directory.cpp will not work and throws an error "error: terminate called after throwing an instance of 'std::length_error' what() basic_string::_M_create" and prematurely exits the program. I have tried setting the value to a temporary variable, and I've tried using swap() with no luck. Could someone please help me get this last function to work? If it is not possible with the way I have the code written, could someone help me with getting the proper code in place so that the function will operate correctly? I will include the .cpp and .h files for reference.





I apologize for how long all of the code is. As a requirement for this assignment everything has to be handled outside of the main.cpp. I've tried everything I can think of, and I am feeling overwhelmed and extremely frustrated. Any help with this matter would be nearly invaluable at this point! Thank you in advance.
1 2 3 4 5 #ifndef COURSE DIRECTORY H #de fine COURSE DIRECTORY H #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
