my dog learned polymorphism
The moose likes C / C++ and the fly likes Issues in understanding the basics of the output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Languages » C / C++
Bookmark "Issues in understanding the basics of the output" Watch "Issues in understanding the basics of the output" New topic
Author

Issues in understanding the basics of the output

Rachit Kumar Saxena
Ranch Hand

Joined: Dec 24, 2011
Posts: 50
Whenever I write:
printf("%3.1d",9);

I get:
9

but printf("%3.2d",9);

Gives:
09 as output.Why?Could anyone explain with the basics?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14952
    
  26

See the documentation for printf, which explains exactly what the format string means.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
Have you checked out Aspose?
 
subject: Issues in understanding the basics of the output
 
It's not a secret anymore!