Re: another newbie question

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Sunday, August 29, 1999 9:10 PM Kat said:


> In the following code:
>
> while ( sequence(thisseq[nest1]) ) do
>     printf(1,"%s\n",thisseq[nest1])
>
> the exw trace screen colors the brackets around the "nest1" in the first
> line, but doesn't color them in the second line. And i wanted the whole
> nested sequence printed as it is shown in the blue screen at the bottom of
> the trace screen, i didn't want the first char of the first nested
sequence.
> What is it i am not understanding here?
>
> Kat,
> perplexed again.

In the reference manual for printf you will find the following:

Comments: Watch out for the following common mistake:
     name="John Smith"
    printf(1, "%s", name)     -- error!


 This will print only the first character, J, of name, as each element of
name is taken to be a separate value to be formatted. You must say this
instead:
     name="John Smith"
    printf(1, "%s", {name})   -- correct

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu