0
//score is a variable that is 
case WM_PAINT:
        hdc = BeginPaint(hWnd, &ps);


        // Update the score here
        EndPaint(hWnd, &ps);
        break;

I am creating a game using windows API and using a score variable to keep track of the score of the user. I want to update the score on the screen everytime the user gains more points. The only function I know that can print text is TextOut. However, it accepts a pointer to a string and its length. Is there a easier way to print variables or do I have to convert my integer to string?

varimax
  • 111
  • 1
  • 13
  • do I have to convert my integer to string? - Yes – Alastair Brown May 30 '16 at 03:44
  • The **[documentation](https://msdn.microsoft.com/en-us/library/windows/desktop/dd145133%28v=vs.85%29.aspx)** of the function you know, is a great place to start to find related stuff. Check out the "See also" list at the bottom. And yes you have to convert your integer to string. `std::to_wstring` comes to mind. – Cheers and hth. - Alf May 30 '16 at 04:40

0 Answers0