「C言語/標準ライブラリ/inttypes.h」の版間の差分

(cat.)
タグ: 2017年版ソースエディター
タグ: 2017年版ソースエディター
intmax_t wcstoimax(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base);
uintmax_t wcstoumax(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base);
</syntaxhighlight>
 
== 具体的な値の例 ==
;[https://paiza.io/projects/zyxtgx-TuJ092oihUfQc3Q?language=c 実際値を表示するプログラム]: <syntaxhighlight lang=c line>
#include <stdio.h>
#include <inttypes.h>
 
int main(void) {
puts("PRId8\t= \"" PRId8 "\"");
puts("PRId16\t= \"" PRId16 "\"");
puts("PRId32\t= \"" PRId32 "\"");
puts("PRId64\t= \"" PRId64 "\"");
puts("PRIdLEAST8\t= \"" PRIdLEAST8 "\"");
puts("PRIdLEAST16\t= \"" PRIdLEAST16 "\"");
puts("PRIdLEAST32\t= \"" PRIdLEAST32 "\"");
puts("PRIdLEAST64\t= \"" PRIdLEAST64 "\"");
puts("PRIdFAST8\t= \"" PRIdFAST8 "\"");
puts("PRIdFAST16\t= \"" PRIdFAST16 "\"");
puts("PRIdFAST32\t= \"" PRIdFAST32 "\"");
puts("PRIdFAST64\t= \"" PRIdFAST64 "\"");
puts("PRIdMAX\t= \"" PRIdMAX "\"");
puts("PRIdPTR\t= \"" PRIdPTR "\"");
puts("PRIi8\t= \"" PRIi8 "\"");
puts("PRIi16\t= \"" PRIi16 "\"");
puts("PRIi32\t= \"" PRIi32 "\"");
puts("PRIi64\t= \"" PRIi64 "\"");
puts("PRIiLEAST8\t= \"" PRIiLEAST8 "\"");
puts("PRIiLEAST16\t= \"" PRIiLEAST16 "\"");
puts("PRIiLEAST32\t= \"" PRIiLEAST32 "\"");
puts("PRIiLEAST64\t= \"" PRIiLEAST64 "\"");
puts("PRIiFAST8\t= \"" PRIiFAST8 "\"");
puts("PRIiFAST16\t= \"" PRIiFAST16 "\"");
puts("PRIiFAST32\t= \"" PRIiFAST32 "\"");
puts("PRIiFAST64\t= \"" PRIiFAST64 "\"");
puts("PRIiMAX\t= \"" PRIiMAX "\"");
puts("PRIiPTR\t= \"" PRIiPTR "\"");
puts("PRIo8\t= \"" PRIo8 "\"");
puts("PRIo16\t= \"" PRIo16 "\"");
puts("PRIo32\t= \"" PRIo32 "\"");
puts("PRIo64\t= \"" PRIo64 "\"");
puts("PRIoLEAST8\t= \"" PRIoLEAST8 "\"");
puts("PRIoLEAST16\t= \"" PRIoLEAST16 "\"");
puts("PRIoLEAST32\t= \"" PRIoLEAST32 "\"");
puts("PRIoLEAST64\t= \"" PRIoLEAST64 "\"");
puts("PRIoFAST8\t= \"" PRIoFAST8 "\"");
puts("PRIoFAST16\t= \"" PRIoFAST16 "\"");
puts("PRIoFAST32\t= \"" PRIoFAST32 "\"");
puts("PRIoFAST64\t= \"" PRIoFAST64 "\"");
puts("PRIoMAX\t= \"" PRIoMAX "\"");
puts("PRIoPTR\t= \"" PRIoPTR "\"");
puts("PRIu8\t= \"" PRIu8 "\"");
puts("PRIu16\t= \"" PRIu16 "\"");
puts("PRIu32\t= \"" PRIu32 "\"");
puts("PRIu64\t= \"" PRIu64 "\"");
puts("PRIuLEAST8\t= \"" PRIuLEAST8 "\"");
puts("PRIuLEAST16\t= \"" PRIuLEAST16 "\"");
puts("PRIuLEAST32\t= \"" PRIuLEAST32 "\"");
puts("PRIuLEAST64\t= \"" PRIuLEAST64 "\"");
puts("PRIuFAST8\t= \"" PRIuFAST8 "\"");
puts("PRIuFAST16\t= \"" PRIuFAST16 "\"");
puts("PRIuFAST32\t= \"" PRIuFAST32 "\"");
puts("PRIuFAST64\t= \"" PRIuFAST64 "\"");
puts("PRIuMAX\t= \"" PRIuMAX "\"");
puts("PRIuPTR\t= \"" PRIuPTR "\"");
puts("PRIx8\t= \"" PRIx8 "\"");
puts("PRIx16\t= \"" PRIx16 "\"");
puts("PRIx32\t= \"" PRIx32 "\"");
puts("PRIx64\t= \"" PRIx64 "\"");
puts("PRIxLEAST8\t= \"" PRIxLEAST8 "\"");
puts("PRIxLEAST16\t= \"" PRIxLEAST16 "\"");
puts("PRIxLEAST32\t= \"" PRIxLEAST32 "\"");
puts("PRIxLEAST64\t= \"" PRIxLEAST64 "\"");
puts("PRIxFAST8\t= \"" PRIxFAST8 "\"");
puts("PRIxFAST16\t= \"" PRIxFAST16 "\"");
puts("PRIxFAST32\t= \"" PRIxFAST32 "\"");
puts("PRIxFAST64\t= \"" PRIxFAST64 "\"");
puts("PRIxMAX\t= \"" PRIxMAX "\"");
puts("PRIxPTR\t= \"" PRIxPTR "\"");
puts("PRIX8\t= \"" PRIX8 "\"");
puts("PRIX16\t= \"" PRIX16 "\"");
puts("PRIX32\t= \"" PRIX32 "\"");
puts("PRIX64\t= \"" PRIX64 "\"");
puts("PRIXLEAST8\t= \"" PRIXLEAST8 "\"");
puts("PRIXLEAST16\t= \"" PRIXLEAST16 "\"");
puts("PRIXLEAST32\t= \"" PRIXLEAST32 "\"");
puts("PRIXLEAST64\t= \"" PRIXLEAST64 "\"");
puts("PRIXFAST8\t= \"" PRIXFAST8 "\"");
puts("PRIXFAST16\t= \"" PRIXFAST16 "\"");
puts("PRIXFAST32\t= \"" PRIXFAST32 "\"");
puts("PRIXFAST64\t= \"" PRIXFAST64 "\"");
puts("PRIXMAX\t= \"" PRIXMAX "\"");
puts("PRIXPTR\t= \"" PRIXPTR "\"");
puts("SCNd8\t= \"" SCNd8 "\"");
puts("SCNd16\t= \"" SCNd16 "\"");
puts("SCNd32\t= \"" SCNd32 "\"");
puts("SCNd64\t= \"" SCNd64 "\"");
puts("SCNdLEAST8\t= \"" SCNdLEAST8 "\"");
puts("SCNdLEAST16\t= \"" SCNdLEAST16 "\"");
puts("SCNdLEAST32\t= \"" SCNdLEAST32 "\"");
puts("SCNdLEAST64\t= \"" SCNdLEAST64 "\"");
puts("SCNdFAST8\t= \"" SCNdFAST8 "\"");
puts("SCNdFAST16\t= \"" SCNdFAST16 "\"");
puts("SCNdFAST32\t= \"" SCNdFAST32 "\"");
puts("SCNdFAST64\t= \"" SCNdFAST64 "\"");
puts("SCNdMAX\t= \"" SCNdMAX "\"");
puts("SCNdPTR\t= \"" SCNdPTR "\"");
puts("SCNi8\t= \"" SCNi8 "\"");
puts("SCNi16\t= \"" SCNi16 "\"");
puts("SCNi32\t= \"" SCNi32 "\"");
puts("SCNi64\t= \"" SCNi64 "\"");
puts("SCNiLEAST8\t= \"" SCNiLEAST8 "\"");
puts("SCNiLEAST16\t= \"" SCNiLEAST16 "\"");
puts("SCNiLEAST32\t= \"" SCNiLEAST32 "\"");
puts("SCNiLEAST64\t= \"" SCNiLEAST64 "\"");
puts("SCNiFAST8\t= \"" SCNiFAST8 "\"");
puts("SCNiFAST16\t= \"" SCNiFAST16 "\"");
puts("SCNiFAST32\t= \"" SCNiFAST32 "\"");
puts("SCNiFAST64\t= \"" SCNiFAST64 "\"");
puts("SCNiMAX\t= \"" SCNiMAX "\"");
puts("SCNiPTR\t= \"" SCNiPTR "\"");
puts("SCNo8\t= \"" SCNo8 "\"");
puts("SCNo16\t= \"" SCNo16 "\"");
puts("SCNo32\t= \"" SCNo32 "\"");
puts("SCNo64\t= \"" SCNo64 "\"");
puts("SCNoLEAST8\t= \"" SCNoLEAST8 "\"");
puts("SCNoLEAST16\t= \"" SCNoLEAST16 "\"");
puts("SCNoLEAST32\t= \"" SCNoLEAST32 "\"");
puts("SCNoLEAST64\t= \"" SCNoLEAST64 "\"");
puts("SCNoFAST8\t= \"" SCNoFAST8 "\"");
puts("SCNoFAST16\t= \"" SCNoFAST16 "\"");
puts("SCNoFAST32\t= \"" SCNoFAST32 "\"");
puts("SCNoFAST64\t= \"" SCNoFAST64 "\"");
puts("SCNoMAX\t= \"" SCNoMAX "\"");
puts("SCNoPTR\t= \"" SCNoPTR "\"");
puts("SCNu8\t= \"" SCNu8 "\"");
puts("SCNu16\t= \"" SCNu16 "\"");
puts("SCNu32\t= \"" SCNu32 "\"");
puts("SCNu64\t= \"" SCNu64 "\"");
puts("SCNuLEAST8\t= \"" SCNuLEAST8 "\"");
puts("SCNuLEAST16\t= \"" SCNuLEAST16 "\"");
puts("SCNuLEAST32\t= \"" SCNuLEAST32 "\"");
puts("SCNuLEAST64\t= \"" SCNuLEAST64 "\"");
puts("SCNuFAST8\t= \"" SCNuFAST8 "\"");
puts("SCNuFAST16\t= \"" SCNuFAST16 "\"");
puts("SCNuFAST32\t= \"" SCNuFAST32 "\"");
puts("SCNuFAST64\t= \"" SCNuFAST64 "\"");
puts("SCNuMAX\t= \"" SCNuMAX "\"");
puts("SCNuPTR\t= \"" SCNuPTR "\"");
puts("SCNx8\t= \"" SCNx8 "\"");
puts("SCNx16\t= \"" SCNx16 "\"");
puts("SCNx32\t= \"" SCNx32 "\"");
puts("SCNx64\t= \"" SCNx64 "\"");
puts("SCNxLEAST8\t= \"" SCNxLEAST8 "\"");
puts("SCNxLEAST16\t= \"" SCNxLEAST16 "\"");
puts("SCNxLEAST32\t= \"" SCNxLEAST32 "\"");
puts("SCNxLEAST64\t= \"" SCNxLEAST64 "\"");
puts("SCNxFAST8\t= \"" SCNxFAST8 "\"");
puts("SCNxFAST16\t= \"" SCNxFAST16 "\"");
puts("SCNxFAST32\t= \"" SCNxFAST32 "\"");
puts("SCNxFAST64\t= \"" SCNxFAST64 "\"");
puts("SCNxMAX\t= \"" SCNxMAX "\"");
puts("SCNxPTR\t= \"" SCNxPTR "\"");
}
</syntaxhighlight>
;実行結果: <syntaxhighlight lang=c line>
PRId8 = "d"
PRId16 = "d"
PRId32 = "d"
PRId64 = "ld"
PRIdLEAST8 = "d"
PRIdLEAST16 = "d"
PRIdLEAST32 = "d"
PRIdLEAST64 = "ld"
PRIdFAST8 = "d"
PRIdFAST16 = "ld"
PRIdFAST32 = "ld"
PRIdFAST64 = "ld"
PRIdMAX = "ld"
PRIdPTR = "ld"
PRIi8 = "i"
PRIi16 = "i"
PRIi32 = "i"
PRIi64 = "li"
PRIiLEAST8 = "i"
PRIiLEAST16 = "i"
PRIiLEAST32 = "i"
PRIiLEAST64 = "li"
PRIiFAST8 = "i"
PRIiFAST16 = "li"
PRIiFAST32 = "li"
PRIiFAST64 = "li"
PRIiMAX = "li"
PRIiPTR = "li"
PRIo8 = "o"
PRIo16 = "o"
PRIo32 = "o"
PRIo64 = "lo"
PRIoLEAST8 = "o"
PRIoLEAST16 = "o"
PRIoLEAST32 = "o"
PRIoLEAST64 = "lo"
PRIoFAST8 = "o"
PRIoFAST16 = "lo"
PRIoFAST32 = "lo"
PRIoFAST64 = "lo"
PRIoMAX = "lo"
PRIoPTR = "lo"
PRIu8 = "u"
PRIu16 = "u"
PRIu32 = "u"
PRIu64 = "lu"
PRIuLEAST8 = "u"
PRIuLEAST16 = "u"
PRIuLEAST32 = "u"
PRIuLEAST64 = "lu"
PRIuFAST8 = "u"
PRIuFAST16 = "lu"
PRIuFAST32 = "lu"
PRIuFAST64 = "lu"
PRIuMAX = "lu"
PRIuPTR = "lu"
PRIx8 = "x"
PRIx16 = "x"
PRIx32 = "x"
PRIx64 = "lx"
PRIxLEAST8 = "x"
PRIxLEAST16 = "x"
PRIxLEAST32 = "x"
PRIxLEAST64 = "lx"
PRIxFAST8 = "x"
PRIxFAST16 = "lx"
PRIxFAST32 = "lx"
PRIxFAST64 = "lx"
PRIxMAX = "lx"
PRIxPTR = "lx"
PRIX8 = "X"
PRIX16 = "X"
PRIX32 = "X"
PRIX64 = "lX"
PRIXLEAST8 = "X"
PRIXLEAST16 = "X"
PRIXLEAST32 = "X"
PRIXLEAST64 = "lX"
PRIXFAST8 = "X"
PRIXFAST16 = "lX"
PRIXFAST32 = "lX"
PRIXFAST64 = "lX"
PRIXMAX = "lX"
PRIXPTR = "lX"
SCNd8 = "hhd"
SCNd16 = "hd"
SCNd32 = "d"
SCNd64 = "ld"
SCNdLEAST8 = "hhd"
SCNdLEAST16 = "hd"
SCNdLEAST32 = "d"
SCNdLEAST64 = "ld"
SCNdFAST8 = "hhd"
SCNdFAST16 = "ld"
SCNdFAST32 = "ld"
SCNdFAST64 = "ld"
SCNdMAX = "ld"
SCNdPTR = "ld"
SCNi8 = "hhi"
SCNi16 = "hi"
SCNi32 = "i"
SCNi64 = "li"
SCNiLEAST8 = "hhi"
SCNiLEAST16 = "hi"
SCNiLEAST32 = "i"
SCNiLEAST64 = "li"
SCNiFAST8 = "hhi"
SCNiFAST16 = "li"
SCNiFAST32 = "li"
SCNiFAST64 = "li"
SCNiMAX = "li"
SCNiPTR = "li"
SCNo8 = "hho"
SCNo16 = "ho"
SCNo32 = "o"
SCNo64 = "lo"
SCNoLEAST8 = "hho"
SCNoLEAST16 = "ho"
SCNoLEAST32 = "o"
SCNoLEAST64 = "lo"
SCNoFAST8 = "hho"
SCNoFAST16 = "lo"
SCNoFAST32 = "lo"
SCNoFAST64 = "lo"
SCNoMAX = "lo"
SCNoPTR = "lo"
SCNu8 = "hhu"
SCNu16 = "hu"
SCNu32 = "u"
SCNu64 = "lu"
SCNuLEAST8 = "hhu"
SCNuLEAST16 = "hu"
SCNuLEAST32 = "u"
SCNuLEAST64 = "lu"
SCNuFAST8 = "hhu"
SCNuFAST16 = "lu"
SCNuFAST32 = "lu"
SCNuFAST64 = "lu"
SCNuMAX = "lu"
SCNuPTR = "lu"
SCNx8 = "hhx"
SCNx16 = "hx"
SCNx32 = "x"
SCNx64 = "lx"
SCNxLEAST8 = "hhx"
SCNxLEAST16 = "hx"
SCNxLEAST32 = "x"
SCNxLEAST64 = "lx"
SCNxFAST8 = "hhx"
SCNxFAST16 = "lx"
SCNxFAST32 = "lx"
SCNxFAST64 = "lx"
SCNxMAX = "lx"
SCNxPTR = "lx"
</syntaxhighlight>
 
4,517

回編集