Kód: Vybrat vše
unsignet int cislo = 123;
char buf[10];
utoa(buf, cislo, 10);
ale já potřebuji aby BUF[] = 0,0,0,0,0,0,0,1,2,3
pomooooc!
![Shocked 8O](./images/smilies/icon_eek.gif)
Moderátor: Moderátoři
Kód: Vybrat vše
unsignet int cislo = 123;
char buf[10];
utoa(buf, cislo, 10);
Kód: Vybrat vše
int main(void)
{
unsigned int cislo = 123;
char buf[10];
snprintf(buf, 9, "%09d", cislo);
printf("%s\n",buf);
getchar();
return 0;
}
Kód: Vybrat vše
void writenum (unsigned int cislo, size_t size, unsigned int x1, unsigned int y1,unsigned char col1, unsigned char col2){
char buf[10];
utoa(buf, cislo, 10);
writetxt(buf,size,x1,y1,col1,col2);
}
Kód: Vybrat vše
#include <stdio.h>
Kód: Vybrat vše
snprintf(buf, "%09d", cislo);
Kód: Vybrat vše
void writenum (unsigned int cislo, size_t size, unsigned int x1, unsigned int y1,unsigned char col1, unsigned char col2){
unsigned char buf[10];
cislo = cislo + 10000;
utoa(buf, cislo, 10);
buf[0] = ' ';
writetxt(buf,size,x1,y1,col1,col2);