C Language Conversion Characters

When programming in C, you use conversion characters — the percent sign and a letter, for the most part — as placeholders for variables you want to display. The following table shows the conversion characters and what they display:



















































Conversion CharacterDisplays Argument (Variable’s Contents) As
%cSingle character
%dSigned decimal integer (int)
%eSigned floating-point value in E notation
%fSigned floating-point value (float)
%gSigned value in %e or %f format, whichever is shorter
%iSigned decimal integer (int)
%oUnsigned octal (base 8) integer (int)
%sString of text
%uUnsigned decimal integer (int)
%xUnsigned hexadecimal (base 16) integer (int)
%%(percent character)








dummies

Source:http://www.dummies.com/how-to/content/c-language-conversion-characters.html

No comments:

Post a Comment