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.

Previous Post
Leave a comment


  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.

  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: Logo

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

Google photo

You are commenting using your Google 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 )

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 220 other followers

  • Back to the Past

    September 2010
    S M T W T F S
  • Time Machine

  • You count!

  • Worldwide Stats

    free counters
%d bloggers like this: