Advertisement

Weird error using itoa

Started by March 19, 2000 10:08 AM
0 comments, last by Ratman 24 years, 11 months ago
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
Invalid memory access, you have to supply a character buffer(char buffer[100]) instead of just a character pointer to nowhere.

This topic is closed to new replies.

Advertisement