in my c++ course we have started classes. I created a class Date which has a default constructer
The private data is
Date::date(int, int,int) that takes mm-dd-yyyy.
int intmonth, day, year;
is to convert the int date to a string date. This is obviously simple, we only have to change the mm to a string, using an enumertion class
string Date::toString() const
Now.. this functon must return a string. Therefore, the string must consist of
My problem: the concationation of this string. I cannot just output to the string, my teacher asked for the function to return a string. In the driver it has
Returnstring = month(intmonth) + " " + day + "st/nd/rd/th" + ", " + year;
I have read about the itoa function.. but i get the same prototype error as everyone else, and i have tried every hint online that have yeildd no results. I have heard of a function in class ostream in standard library? Does anyone know a good way to convert these integers to strings so i can do the concatination.
cout << d1.toString();
I use pico, and the sun compiler if it helps..