char console[256];
sprintf_s(console, 256, "fps: %d", xGetFPS());
xText (10, 20, console);
|
В виду того, что я делаю это в кодеблокс, а оно использует линуксячий компилятор.
То не смотря на эту строку в самом начале:#include <stdio.h>
Оно мне пишет:
"error: 'sprintf_s' was not declared in this scope|"
А при sprintf(console, 256, "fps: %d", xGetFPS());
error: invalid conversion from 'int' to 'const char*'
и
error: initializing argument 2 of 'int sprintf(char*, const char*, ...)'|
в виде
char console[256];
sprintf(console, "%d", xGetFPS());
xText (10, 30, console);
|
Работает, так можно или это плохо? а "%d" обозначает добавить к строке?
Мой перевод в аргб, тупо работает
int ARGB(int a,int r,int b, int g){
int colora=(a<<24)+(r<<16)+(b<< +g;
return colora;
};
xWritePixel (100,100,ARGB(255,255,0, 0));
|