www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/28/00:44:14

Message-Id: <351C6FD4.7393@nease.net>
Date: Sat, 28 Mar 1998 11:34:44 +0800
From: Cloud Wu <cloudwu AT nease DOT net>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
Subject: cprintf() 's question

I'm a new user of djgpp.
Yesterday, I wrote a program by djgpp.
I want to print the left 80 char of a string,
and use cprinf like this

#define WIDTH 80

char s[200];
...
gotoxy(1,1);
cprintf("%-*s",WIDTH,s);
...

but, the left of my string s was cut. :-(
The right part of the string was printed in the middle of screen.
I remember, "%-*s" is to say leftjustify the output,
Why?
In Borland C, this is correct.
btw, I use djgpp 2.8.0 and djdev2.01

- Raw text -


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