Re: printf fix

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

Bernie Ryan writes:
> The purpose of the sprintf is to format a string.
>  \t is a formatting character.
> All it takes in the interpeter is to expand \t into to 8 spaces.

sprintf() should not expand tabs because:

    1. How does it know how many spaces equals one tab?
        8 is common, but by no means universal.

    2. How does it know how many spaces to the next tab stop?
        It has no concept of the current column position.

The tabs will be expanded when and if you choose to print
the result of sprintf() on some device that understands tabs.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu