I want to display the fps for my app. heres part of my code:
I cant make it 4 fields but i cant get the length of a int so what do you do for this ?Code:case WM_PAINT: TextOut(hDC,1,1,fcount,lstrlen(fcount)); //fcount = int
I want to display the fps for my app. heres part of my code:
I cant make it 4 fields but i cant get the length of a int so what do you do for this ?Code:case WM_PAINT: TextOut(hDC,1,1,fcount,lstrlen(fcount)); //fcount = int
Use sprintf to convert the int to a string
Code:char buff[20]; sprintf( buff, "%d", fcount ); TextOut(hDC,1,1,buff,lstrlen(buff));
i tried that but the compiler said sprintf was a undeclared identitifier ?
You want to include <stdio.h> to use sprintf
I suggest dont use Sprintf() use the atoi(); or itoa() for conversions.
it has more options if you are using MSVC++...
also look at _atio() and _itoa() in the MSDN library
LB0: * Life once school is done
LB1: N <- WakeUp;
LB2: N <- C++_Code;
LB3: N >= Tired : N <- Sleep;
LB4: JMP*-3;