S Siajj Still Fresh Joined Apr 22, 2004 Messages 12 Jun 4, 2004 #1 How can i use GpTextOut to output a variable, at the moment i am using: GpTextOut(NULL, &gpDraw[nflip], count * TILESIZE, count2 * TILESIZE, count3, 0); but all it is displaying is symbols.
How can i use GpTextOut to output a variable, at the moment i am using: GpTextOut(NULL, &gpDraw[nflip], count * TILESIZE, count2 * TILESIZE, count3, 0); but all it is displaying is symbols.
don AWSMOE! Joined Dec 23, 2003 Messages 635 Location $$$GERMONEY$$$ Website gp32.chemicalkungfu.de Jun 4, 2004 #2 You need to convert your int/float/whatever numerical variable to a string. You might do it with sprintf from <stdio.h>: sprintf(count_string, "%i", count*tilesize); GpTextOut(NULL, &gpDraw[nFlip], count_string, 0);
You need to convert your int/float/whatever numerical variable to a string. You might do it with sprintf from <stdio.h>: sprintf(count_string, "%i", count*tilesize); GpTextOut(NULL, &gpDraw[nFlip], count_string, 0);
S Siajj Still Fresh Joined Apr 22, 2004 Messages 12 Jun 5, 2004 #3 great, problem is i'm now getting an error: warning: passing arg 1 of 'sprintf' makes pointer from integer without a cast what does this error and how can i fix it???
great, problem is i'm now getting an error: warning: passing arg 1 of 'sprintf' makes pointer from integer without a cast what does this error and how can i fix it???
don AWSMOE! Joined Dec 23, 2003 Messages 635 Location $$$GERMONEY$$$ Website gp32.chemicalkungfu.de Jun 5, 2004 #4 Did you declare the string you're using? You need to declare it (big enough!) before using it with sprintf: char count_string[100]; sprintf(count_string, "%i", count*tilesize); GpTextOut(NULL, &gpDraw[nFlip], count_string, 0);
Did you declare the string you're using? You need to declare it (big enough!) before using it with sprintf: char count_string[100]; sprintf(count_string, "%i", count*tilesize); GpTextOut(NULL, &gpDraw[nFlip], count_string, 0);