Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Urgent Dount regarding printf

Posted on 2006-04-04
3
Medium Priority
?
185 Views
Last Modified: 2010-04-15
Can any one please tell me whats is the difference in between the %d and %2d in printf statements.

Early help are greatly appreciated

Regards

Jango
0
Comment
Question by:jango_ms
  • 2
3 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 16378611
2 is minimal number of digits printed in this field. For example, if number is 1, %d prints "1", and %2d prints " 1".
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 200 total points
ID: 16378616
Correction: "minimal number of characters".
Other example: %02d prints "01" in the same case.
0
 
LVL 2

Expert Comment

by:zulti
ID: 16378857
RTFM
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Suggested Courses
Course of the Month15 days, 19 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question