入・出力変換指定子 共通
指定子 | 型 | 説明 |
---|---|---|
%c | char | 1文字を出力する |
%s | char * | 文字列を出力する |
%d | int, short | 整数を10進で出力する |
%u | unsigned int, unsigned short | 符号なし整数を10進で出力する |
%o | int, short, unsigned int, unsigned short | 整数を8進で出力する |
%x | int, short, unsigned int, unsigned short | 整数を16進で出力する |
%f | float | 実数を出力する |
%ld | long | 倍精度整数を10進で出力する |
%lu | unsigned long | 符号なし倍精度整数を10進で出力する |
%lo | long, unsigned long | 倍精度整数を8進で出力する |
%lx | long, unsigned long | 倍精度整数を16進で出力する |
%lf | double | 倍精度実数を出力する |
出力変換指定子のみ
指定子 | 型 | 説明 |
---|---|---|
%e | float | 実数を指数表示で出力する |
%g | float | 実数を最適な形式で出力する |
入力変換指定子のみ
指定子 | 型 | 説明 |
---|---|---|
%hd | short | 単精度整数を10進数として入力する |
%hu | unsigned short | 符号なし単精度整数を10進数として入力する |