Format Specifiers


Format specifiers are the percent character, followed by a letter, such as %d or %f that tell NSLog or printf() to print the value or result of a variable, value, and/or expression.

Here is a list of C format specifiers:

Format Specifiers in C

Just think of them as types of placeholders, each designed to represent a different value.

About these ads
Previous Post
Leave a comment

3 Comments

  1. Kevin M.

     /  September 17, 2012

    There’s also %@ to be used when you want to display an object in an NSLog. Secretly, it’s running the -description method on an object, which returns a string. When you’re beginning, you’ll probably use this to print NSString ‘s.

    http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/Strings/Articles/formatSpecifiers.html

    Reply
  1. Learn Objective-C in 24 Days « Programming for iOS
  2. Extension 13: Complex Initializers « Programming for iOS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Welcome

    My goal is to make CupsOfCocoa into a beautiful source for beginners to the iPhone platform to get started. Subscribe below for more, and stay tuned!

  • Contact Me

    If you need to contact me for any reason, feel free to send me an email.
  • The Giving Spirit

    If you've found this site helpful, would you consider donating a little sum? Any amount is appreciated...Thanks so much!

  • Roadmap

  • Enter your email address to follow this blog and receive notifications of new posts by email.

    Join 226 other followers

  • Back to the Past

    September 2010
    S M T W T F S
    « Aug   Oct »
     1234
    567891011
    12131415161718
    19202122232425
    2627282930  
  • Time Machine

  • You count!

    • 590,658 views
  • Worldwide Stats

    free counters
Follow

Get every new post delivered to your Inbox.

Join 226 other followers

%d bloggers like this: