Mail Archives: djgpp/1999/09/20/15:27:43
1.- Using sprintf
sprintf is to write to a string variable
int i;
char string[10];
sprintf(string, "%02d", i);
This function is very usefull is you are concatenating strings
char string2[]="objets are ";
strcat(string2,string1);
printf("%s", string2);
2.- Using printf
printf is to writo to screen
int i;
printf("%02d", i);
----- Original Message -----
From: Roger <roger AT pepparkakor DOT demon DOT nl>
To: <djgpp AT delorie DOT com>
Sent: Saturday, September 18, 1999 1:15 PM
Subject: Re: About numbers.
> Please.tell me more how do you mean with sprintf..
> I use printf already,but maybe I can do more?
>
> Diego Castro wrote:
>
> > use the sprintf function with the number you get from random
> >
> > ----- Original Message -----
> > From: Roger <roger AT pepparkakor DOT demon DOT nl>
> > To: <djgpp AT delorie DOT com>
> > Sent: Friday, September 17, 1999 2:27 PM
> > Subject: About numbers.
> >
> > > How do I get dubbeldigit numbers? If my randomize get number 4,then I
want
> > it
> > > to write out 04..Can I do it in Rhide??
> > >
>
>
- Raw text -