• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: # flag used with printf warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: # flag used with printf warning


  • Subject: Re: # flag used with printf warning
  • From: Ricky Sharp <email@hidden>
  • Date: Tue, 27 Apr 2004 15:15:20 -0500

On Apr 27, 2004, at 1:01 PM, Chris Espinosa wrote:

On Apr 26, 2004, at 9:38 PM, Ken Turkowski wrote:

What OS lets you use # with %s in (s)printf?  A quick Google search
brought back only printf man pages that say that # has no effect on
%s.
  What alternate form could a string have?

Pascal strings are length prefixed.

The portable way to printf a Pascal string is

printf("%*s\n", pstring[0], &pstring[1]);

Thanks, Chris. That will allow for a more "one-to-one" replacement of my existing code.


___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Founder & President
Instant Interactive(tm)   http://www.instantinteractive.com
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: # flag used with printf warning (From: Ken Turkowski <email@hidden>)
 >Re: # flag used with printf warning (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: FAQ: Compile problems when multiple headers in project have same name
  • Next by Date: Re: Integrating gcc-based D compiler
  • Previous by thread: Re: # flag used with printf warning
  • Next by thread: Re: # flag used with printf warning
  • Index(es):
    • Date
    • Thread