22 lines
653 B
Markdown
22 lines
653 B
Markdown
![]() |
---
|
||
|
id: 5faz2y2e
|
||
|
title: Format specifiers in C
|
||
|
tags: []
|
||
|
created: Thursday, February 29, 2024 | 17:41
|
||
|
---
|
||
|
|
||
|
# Format specifiers in C
|
||
|
|
||
|
Format specifiers define the type of data to be printed on standard output. You
|
||
|
need to use format specifiers whenever you are
|
||
|
[printing-values-in-c](printing-values-in-c.md).
|
||
|
|
||
|
| Specifier | Usage |
|
||
|
| --------- | -------------------------- |
|
||
|
| `%c` | single character |
|
||
|
| `%s` | string |
|
||
|
| `%n` | nothing |
|
||
|
| `%d` | integer (assuming base 10) |
|
||
|
| `%f` | float |
|
||
|
| `%%` | The percent sign itself |
|