Re: [BUG] [OFF TOPIC] show shops CRASH

From: Invincibill (wlong@E-SERVER.NET)
Date: 10/18/98


you guys are kidding right?

you mean to tell me that you are tackling Circle Code and you dont know
about conversion specifiers?

the %6d is the width which will be reserved for printing.
say you have the following

for (i=x=1;i<=6;i++) {
  x=x*10;
  printf("my number is |%6d|\n\r",x);
}
you would get
my number is |    10|
my number is |   100|
my number is |  1000|
my number is | 10000|
my number is |100000|
my number is |1000000|

if you put the printf("my number is |%-6d|\n\r",x);
my number is |10    |
my number is |100   |

and so on.

this is really basic knowledge. i would very highly suggest that if you
dont know this, go find a C primer on the net or get a C book.  There
are lots of really cool things you can do with conversion specifiers(for
both input and output)

Jourge Fuzz Bush wrote:
>
> Um, I think it has something to do with the size of the int. Like say
> you want to display a long int it would be %ld so %6d might be 6 digits
> or something....... Or represent a short int.
>
> Del wrote:
> >
> > Julian Buckley wrote:
> > >
> > > > > 1162          sprintf(buf1, "%6d", mob_index[SHOP_KEEPER(shop_nr)].virtual);
> > > > >
> > > >
> > > > Is this a typo? or does your code actually have a "%6d"
> > >
> > > What's wrong with %6d?  I see no problem with it...
> > >
> >
> > What does the %6d do, compared to %d?
> >
> > >From what I have learned the %d is basically the decimal value of the variable
> > listed. so what is %6d?
> >
> >      +------------------------------------------------------------+
> >      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
> >      | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
> >      +------------------------------------------------------------+
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>      +------------------------------------------------------------+

--
reply to wlong<@>e-server.net...spam avoidance policy in effect.
check out www.giftsgalore.com, lots 'o neat stuff there.
GO JOHNNY!!! GO BILL!!!


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST