Hi folks,
I have a problem with AfxMessageBox.
Consider the following snippet:
--------------SNIP------------------------
int i = 3;
char * Indice = new char[4];
_snprintf(Indice, 2, "%d", i);
AfxMessageBox(LPCTSTR(Indice));
--------------END SNIP--------------------
The MessageBox pops with '3' followed by some garbage.
_snprintf should put \0 at the end of converted string. Just to trust
nobody I've tried to add it by myself, too, but the garbage is still
present.
What I did wrong?
TIA
Jake