Need help fixing in Unhandled Exception in C++ -
I wrote this simple program according to the UML guidelines which I was given but it is difficult to find out that it Why throwing is an exception when I run it when the code itself compiles while code is run and if I continue for a long time, then it is successfully run to complete the code, but I'm guessing that It should not do this A who does this. Unwanted exceptions to [Memory address] in [Show.exe]: Microsoft C ++ Exception: Four [separate memory address] at the memory location "
This uses it twice if I continue the hit But until the tester does not specifically display it, I'm in the form of a way to fix it (I do not really know what an exception is either);
< Pre> #include & lt; string & gt; # include & lt; iostream & gt; Using the namespace STD; class day type {Private: string day; public: day type;} string adidas (int_num); day type (string_days); string getDay (); zero setday (string_de); string Next Day (); String Prechata (); Zero Print ();};
Functions.cpp
#include # Include & lt; iostream & gt; # Include & lt; Exception & gt; #include "dayType.h" using namespace std; string arr_day [7] = {"Sunday", " Omwar "," Tuesday "," Wednesday "," Thursday "," Friday "," Saturday "}; DayType :: dayType () {days = "-"; } String day type: addDays (int _num) {int num = distance (arr_day, find (arr_day, arr_day + 7, day)); Num = num + _num; Try (num (num> 7) num - = 7; return arr_day [num];} hold (...) {cout
Examiner file provided:
// ****************** **************************************************************************************************** Chapter 1: Programming Exercise 3 / ***** ************************************************************************************** Add *************** Iostream & gt; #include & lt; String & gt; #include "dayType.h"; using namespace std; Int main () {dayType myDay ("Monday"); Cout & lt; & Lt; "my description:"; MyDay.print (); Cout & lt; & Lt; Endl; Cout & lt; & Lt; "Maida =" & lt; & Lt; MyDay.getDay () & lt; & Lt; ", Alternation =" & lt; & Lt; MyDay.prevDay () & lt; & Lt; Endl; Cout & lt; & Lt; "Maida =" & lt; & Lt; MyDay.getDay () & lt; & Lt; ", Next day =" & lt; & Lt; MyDay.nextDay () & lt; & Lt; Endl; Cout & lt; & Lt; After adding "MyDay 8:" & lt; & Lt; MyDay.addDays (8) & lt; & Lt; Endl; {Try MyDay.setDay ("ZZZZ"); } Hold (exception e) {cout & lt; & Lt; E.what () & lt; & Lt; Endl; } System ("pause"); Return 0; }
Comments
Post a Comment