Guest KM Posted April 28, 2004 Report Posted April 28, 2004 Hi, I tried to convert an int to a string, but he shows me 0, 5, and then nothing. Here the source: har Te [40]; sprintf(Te, "%i", TalerNr); if (MessageBox (MainWindow, (unsigned short *)Te, TEXT("Punktzahl"), MB_OK | MB_ICONINFORMATION) == MB_OK);
Guest MrMagoo Posted April 29, 2004 Report Posted April 29, 2004 Hi, I tried to convert an int to a string, but he shows me 0, 5, and then nothing. Here the source: har Te [40]; sprintf(Te, "%i", TalerNr); if (MessageBox (MainWindow, (unsigned short *)Te, TEXT("Punktzahl"), MB_OK | MB_ICONINFORMATION) == MB_OK); i think the correct placeholder for an integer is %d in printf, but also you might be better of declaring Te as a TCHAR and using wsprintf TCHAR Te[40]; wsprintf(Te, L"%d", TalerNr); if (MessageBox (MainWindow, Te, TEXT("Punktzahl"), MB_OK | MB_ICONINFORMATION) == MB_OK);
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now