Weird error using itoa
This has been driving me crazy lately, but I finally found what was causing my program to not work on about 50% of the computers I tried it on: My frames per second counter. In particular, when I convert my number of frames to a char*. Here is the code
///////////////////////////
//Globablly
long Clock =0;
int count = 0;
int frame = 0;
int Time = 0;
int Timelast = 0;
/////////////////////////
//Frames per second
char* buff;
Time = timeGetTime();
count++;
if(Time - Timelast >= 1000)
{
frame = count;
Timelast = Time;
count = 0;
}
itoa(frame, buff, 10);
Anyone have any ideas? The program just exits on most computers, no errors or anythin...
Thanks
Dave
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement