printf : printf « stdio.h « C Tutorial

C Tutorial
1. Language
2. Data Type
3. String
4. printf scanf
5. Operator
6. Statement
7. Array
8. Function
9. Structure
10. Pointer
11. Memory
12. Preprocessor
13. File
14. Data Structure
15. Search Sort
16. Wide Character String
17. assert.h
18. ctype.h
19. math.h
20. setjmp.h
21. signal.h
22. stdio.h
23. stdlib.h
24. string.h
25. time.h
26. wctype.h
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
C Tutorial » stdio.h » printf 
22. 24. 1. printf
ItemValue
Header filestdio.h
Declarationint printf(const char *format, ...);
Functiondisplay message by format.
Returnthe number of characters actually printed. A negative value indicates failure.


#include <stdio.h>

int main(void){
 printf("Hi %c %d %s"'c'10"there!");
}
Hi c 10 there!

The printf() Format Specifiers

CodeFormat
%aHexadecimal output in the form 0xh.hhhhp+d (C99 only).
%AHexadecimal output in the form 0Xh.hhhhP+d (C99 only).
%cCharacter.
%dSigned decimal integers.
%iSigned decimal integers.
%eScientific notation (lowercase e).
%EScientific notation (uppercase E).
%fDecimal floating point.
%FDecimal floating point (C99 only; produces uppercase INF, INFINITY, or NAN when applied to infinity or a value that is not a number. The %f specifier produces lowercase equivalents.)
%gUses %e or %f, whichever is shorter.
%GUses %E or %F, whichever is shorter.
%oUnsigned octal.
%sString of characters.
%uUnsigned decimal integers.
%xUnsigned hexadecimal (lowercase letters).
%XUnsigned hexadecimal (uppercase letters).
%pDisplays a pointer.
%nThe associated argument must be a pointer to an integer. This specifier causes the number of characters written (up to the point at which the %n is encountered) to be stored in that integer.
%%Prints a percent sign.


22. 24. printf
22. 24. 1. printf
ww___w_._j___a__v__a2___s.c_o__m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.