Ok, I'm having some annoying problems...
I have a function to get the FPS, GetFPS(), which returns a float value;
I currently have:
Code:
char Text[40] = "";
float Num = GameTimer->GetFPS();
sprintf(Text, "%d", Num);
int i=0;
static TCHAR tstr[40];
while (tstr[i]=(TCHAR)Text[i++]);
MessageBox(NULL, (LPCWSTR)tstr, L"HI", MB_OK);
The MessageBox displays 0 where the actual value is 80.9.
I tried _stprintf also:
Code:
wchar_t* Text;
Text = _T("");
float Num = GameTimer->GetFPS();
_stprintf(Text, _T("%d"), Num);
MessageBox(NULL, (LPCWSTR)Text, L"HI", MB_OK);
which kicks out the error:
Unhandled exception at 0x5a283abe (msvcr90d.dll) in CompleteGameEngine.exe: 0xC0000005: Access violation writing location 0x00f6999c.
Arghhh!!
Thanks