On this page
  1. printf
  2. Include
  3. Signature & Overview
  4. Notes & Pitfalls
  5. Example

printf

Prev: stdio.h | Up: stdio.h | Next: fprintf
Rel: stdio.h, stdio.h & File I/O Guide
Ref: cppreference — printf
Tags: #public #prog #c #stdlib #stdio #tier/core


Include

#include <stdio.h>

Signature & Overview

int printf(const char *restrict fmt, ...);

Writes formatted output to stdout; returns number of characters written or negative on error.

Notes & Pitfalls

Example

#include <stdio.h>

int main(void) {
    printf("name=%s count=%zu\n", "widgets", (size_t)42);
}

Linked from

Related notes