TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: ALL
from: Marc Tritschler 100344,2706
date: 1995-08-31 06:06:06
subject: fprintf in Ultra-C

#: 21165 S3/Languages
    31-Aug-95  06:06:06
Sb: fprintf in Ultra-C
Fm: Marc Tritschler 100344,2706
To: ALL

Hi all,

I am finding that I get inconsistent results when passing some format commands
to fprintf in Ultra-C. For example, the following code :-

fprintf(fp,"%02d",value);

should print a two digit value, with the first digit being a zero if the value
is less than 10. In some cases this works OK, but in others I get a leading
space instead of a zero when the value is less than 10.

Anybody else seen this and know how to avoid it ?

By the way, I am compiling without the -i option.

Marc.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.