delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/20/15:27:43

Message-ID: <00b001bf03a5$d76c4f30$14010a0a@megared.net.mx>
From: "Diego Castro" <dcastro AT megacable DOT com DOT mx>
To: <djgpp AT delorie DOT com>
References: <7rmff2$5rt$1 AT nnrp1 DOT deja DOT com> <Pine DOT SOL DOT 3 DOT 96 DOT 990916075736 DOT 4565B-100000 AT giasbga> <37E2A43F DOT 42F5E42B AT pepparkakor DOT demon DOT nl> <001b01bf0168$141dd830$14010a0a AT megared DOT net DOT mx> <37E3E4BB DOT DFA16480 AT pepparkakor DOT demon DOT nl>
Subject: Re: About numbers.
Date: Mon, 20 Sep 1999 14:22:20 -0600
Organization: Megacable
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019