I'm parsing a date into three ints, then manipulating them. I then want to convert them back into strings so I can concactenate them with the slashes so I can search an array of dates saved in string format. I looked around and this code seems like it should work, but everytime run it it crashes.
string sMonth, sYear, sDay = "";
// Everything in this code is initialized and works well until it hits this itoa
char *Mptr;
sMonth = itoa(lastM, Mptr, 10);
sMonth = Mptr;
char *Dptr;
Dptr = itoa(lastD, Dptr, 10);
sDay = Dptr;
char *Yptr;
Yptr = itoa(lastY, Yptr, 10);
sYear = Yptr;
lastYear = sDay + "/" + sMonth + "/" + sYear;
cout << endl << lastYear; //lastM << "/" << lastD << "/" << lastY << endl;