www.delorie.com/djgpp/doc/libc/libc_624.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

printf

Syntax

 
#include <stdio.h>

int printf(const char *format, ...);

Description

Sends formatted output from the arguments (...) to stdout.

The format string contains regular characters to print, as well as conversion specifiers, which begin with a percent symbol. Each conversion speficier contains the following fields:

Return Value

The number of characters written.

Portability

ANSI/ISO C C89; C99 (see note 1) (see note 2)
POSIX 1003.2-1992; 1003.1-2001

Notes:

  1. The hh, j, t and z conversion specifiers first appeared in the ANSI C99 standard.

  2. The D, O and U conversion types are non-standard. gcc may generate warnings, if you use them.

Example

 
printf("%-3d %10.2f%% Percent of %s\n", index, per[index], name[index]);


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004