名稱空間
變體
操作

標準庫標頭檔案 <cinttypes> (C++11)

來自 cppreference.com
 
 
標準庫標頭檔案
演算法
<algorithm>
<numeric>
字串
<cctype>
<cstring>
<cuchar> (C++11)
<cwchar>
<cwctype>
<string_view> (C++17)
<string>
文字處理
<clocale>
<codecvt> (C++11/17/26*)
<locale>
<regex> (C++11)
<text_encoding> (C++26)   
數值
<cfenv> (C++11)
<cmath>
<complex>
<linalg> (C++26)
<numbers> (C++20)
<random> (C++11)
<simd> (C++26)
<valarray>
時間
<chrono> (C++11)
<ctime>
C 相容性
<ccomplex> (C++11/17/20*)
<ciso646> (until C++20)
<cstdalign> (C++11/17/20*)
<cstdbool> (C++11/17/20*)
<ctgmath> (C++11/17/20*)
 

此標頭檔案最初在 C 標準庫中,為 <inttypes.h>

目錄

包含

(C++11)
固定寬度整數型別其他型別的限制[編輯]

型別

(C++11)
結構型別,由 std::imaxdiv 返回
(typedef) [編輯]

函式

計算整數值的絕對值 (|x|)
(函式) [編輯]
計算整數除法的商和餘數
(函式) [編輯]
(C++11)(C++11)
將位元組字串轉換為 std::intmax_tstd::uintmax_t
(函式) [編輯]
(C++11)(C++11)
將寬字串轉換為 std::intmax_tstd::uintmax_t
(函式) [編輯]

用於 std::fprintf 函式家族的格式常量
PRId8PRId16PRId32PRId64PRIdLEAST8PRIdLEAST16PRIdLEAST32PRIdLEAST64PRIdFAST8PRIdFAST16PRIdFAST32PRIdFAST64PRIdMAXPRIdPTR
(C++11)
格式轉換說明符,用於輸出型別為 std::int8_tstd::int16_tstd::int32_tstd::int64_tstd::int_least8_tstd::int_least16_tstd::int_least32_tstd::int_least64_tstd::int_fast8_tstd::int_fast16_tstd::int_fast32_tstd::int_fast64_tstd::intmax_tstd::intptr_t 的有符號十進位制整數值,等價於 intd
(宏常量)
PRIi8PRIi16PRIi32PRIi64PRIiLEAST8PRIiLEAST16PRIiLEAST32PRIiLEAST64PRIiFAST8PRIiFAST16PRIiFAST32PRIiFAST64PRIiMAXPRIiPTR
(C++11)
格式轉換說明符,用於輸出型別為 std::int8_tstd::int16_tstd::int32_tstd::int64_tstd::int_least8_tstd::int_least16_tstd::int_least32_tstd::int_least64_tstd::int_fast8_tstd::int_fast16_tstd::int_fast32_tstd::int_fast64_tstd::intmax_tstd::intptr_t 的有符號十進位制整數值,等價於 inti
(宏常量)
PRIu8PRIu16PRIu32PRIu64PRIuLEAST8PRIuLEAST16PRIuLEAST32PRIuLEAST64PRIuFAST8PRIuFAST16PRIuFAST32PRIuFAST64PRIuMAXPRIuPTR
(C++11)
格式轉換說明符,用於輸出型別為 std::uint8_tstd::uint16_tstd::uint32_tstd::uint64_tstd::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_tstd::uint_fast8_tstd::uint_fast16_tstd::uint_fast32_tstd::uint_fast64_tstd::uintmax_tstd::uintptr_t 的無符號十進位制整數值,等價於 unsigned intu
(宏常量)
PRIo8PRIo16PRIo32PRIo64PRIoLEAST8PRIoLEAST16PRIoLEAST32PRIoLEAST64PRIoFAST8PRIoFAST16PRIoFAST32PRIoFAST64PRIoMAXPRIoPTR
(C++11)
格式轉換說明符,用於輸出型別為 std::uint8_tstd::uint16_tstd::uint32_tstd::uint64_tstd::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_tstd::uint_fast8_tstd::uint_fast16_tstd::uint_fast32_tstd::uint_fast64_tstd::uintmax_tstd::uintptr_t 的無符號八進位制整數值,等價於 unsigned into
(宏常量)
PRIx8PRIx16PRIx32PRIx64PRIxLEAST8PRIxLEAST16PRIxLEAST32PRIxLEAST64PRIxFAST8PRIxFAST16PRIxFAST32PRIxFAST64PRIxMAXPRIxPTR
(C++11)
格式轉換說明符,用於輸出型別為 std::uint8_tstd::uint16_tstd::uint32_tstd::uint64_tstd::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_tstd::uint_fast8_tstd::uint_fast16_tstd::uint_fast32_tstd::uint_fast64_tstd::uintmax_tstd::uintptr_t 的無符號小寫十六進位制整數值,等價於 unsigned intx
(宏常量)
PRIX8PRIX16PRIX32PRIX64PRIXLEAST8PRIXLEAST16PRIXLEAST32PRIXLEAST64PRIXFAST8PRIXFAST16PRIXFAST32PRIXFAST64PRIXMAXPRIXPTR
(C++11)
格式轉換說明符,用於輸出型別為 std::uint8_tstd::uint16_tstd::uint32_tstd::uint64_tstd::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_tstd::uint_fast8_tstd::uint_fast16_tstd::uint_fast32_tstd::uint_fast64_tstd::uintmax_tstd::uintptr_t 的無符號大寫十六進位制整數值,等價於 unsigned intX
(宏常量)
用於 std::fscanf 函式家族的格式常量
SCNd8SCNd16SCNd32SCNd64SCNdLEAST8SCNdLEAST16SCNdLEAST32SCNdLEAST64SCNdFAST8SCNdFAST16SCNdFAST32SCNdFAST64SCNdMAXSCNdPTR
(C++11)
格式轉換說明符,用於輸入型別為 std::int8_tstd::int16_tstd::int32_tstd::int64_tstd::int_least8_tstd::int_least16_tstd::int_least32_tstd::int_least64_tstd::int_fast8_tstd::int_fast16_tstd::int_fast32_tstd::int_fast64_tstd::intmax_tstd::intptr_t 的有符號十進位制整數值,等價於 intd
(宏常量)
SCNi8SCNi16SCNi32SCNi64SCNiLEAST8SCNiLEAST16SCNiLEAST32SCNiLEAST64SCNiFAST8SCNiFAST16SCNiFAST32SCNiFAST64SCNiMAXSCNiPTR
(C++11)
格式轉換說明符,用於輸入型別為 std::int8_tstd::int16_tstd::int32_tstd::int64_tstd::int_least8_tstd::int_least16_tstd::int_least32_tstd::int_least64_tstd::int_fast8_tstd::int_fast16_tstd::int_fast32_tstd::int_fast64_tstd::intmax_tstd::intptr_t 的有符號十進位制/八進位制/十六進位制整數值,等價於 inti
(宏常量)
SCNu8SCNu16SCNu32SCNu64SCNuLEAST8SCNuLEAST16SCNuLEAST32SCNuLEAST64SCNuFAST8SCNuFAST16SCNuFAST32SCNuFAST64SCNuMAXSCNuPTR
(C++11)
格式轉換說明符,用於輸入型別為 std::uint8_tstd::uint16_tstd::uint32_tstd::uint64_tstd::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_tstd::uint_fast8_tstd::uint_fast16_tstd::uint_fast32_tstd::uint_fast64_tstd::uintmax_tstd::uintptr_t 的無符號十進位制整數值,等價於 unsigned intu
(宏常量)
SCNo8SCNo16SCNo32SCNo64SCNoLEAST8SCNoLEAST16SCNoLEAST32SCNoLEAST64SCNoFAST8SCNoFAST16SCNoFAST32SCNoFAST64SCNoMAXSCNoPTR
(C++11)
格式轉換說明符,用於輸入型別為 std::uint8_tstd::uint16_tstd::uint32_tstd::uint64_tstd::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_tstd::uint_fast8_tstd::uint_fast16_tstd::uint_fast32_tstd::uint_fast64_tstd::uintmax_tstd::uintptr_t 的無符號八進位制整數值,等價於 unsigned into
(宏常量)
SCNx8SCNx16SCNx32SCNx64SCNxLEAST8SCNxLEAST16SCNxLEAST32SCNxLEAST64SCNxFAST8SCNxFAST16SCNxFAST32SCNxFAST64SCNxMAXSCNxPTR
(C++11)
格式轉換說明符,用於輸入型別為 std::uint8_tstd::uint16_tstd::uint32_tstd::uint64_tstd::uint_least8_tstd::uint_least16_tstd::uint_least32_tstd::uint_least64_tstd::uint_fast8_tstd::uint_fast16_tstd::uint_fast32_tstd::uint_fast64_tstd::uintmax_tstd::uintptr_t 的無符號十六進位制整數值,等價於 unsigned intx
(宏常量)

[編輯] 概要

#include <cstdint>
 
namespace std
{
    using imaxdiv_t = /* see description */;
 
    constexpr intmax_t imaxabs(intmax_t j);
    constexpr imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
    intmax_t strtoimax(const char* nptr, char** endptr, int base);
    uintmax_t strtoumax(const char* nptr, char** endptr, int base);
    intmax_t wcstoimax(const wchar_t* nptr, wchar_t** endptr, int base);
    uintmax_t wcstoumax(const wchar_t* nptr, wchar_t** endptr, int base);
 
    constexpr intmax_t abs(intmax_t);            // optional, see description
    constexpr imaxdiv_t div(intmax_t, intmax_t); // optional, see description
}
 
#define PRIdN /* see description */
#define PRIiN /* see description */
#define PRIoN /* see description */
#define PRIuN /* see description */
#define PRIxN /* see description */
#define PRIXN /* see description */
#define SCNdN /* see description */
#define SCNiN /* see description */
#define SCNoN /* see description */
#define SCNuN /* see description */
#define SCNxN /* see description */
#define PRIdLEASTN /* see description */
#define PRIiLEASTN /* see description */
#define PRIoLEASTN /* see description */
#define PRIuLEASTN /* see description */
#define PRIxLEASTN /* see description */
#define PRIXLEASTN /* see description */
#define SCNdLEASTN /* see description */
#define SCNiLEASTN /* see description */
#define SCNoLEASTN /* see description */
#define SCNuLEASTN /* see description */
#define SCNxLEASTN /* see description */
#define PRIdFASTN /* see description */
#define PRIiFASTN /* see description */
#define PRIoFASTN /* see description */
#define PRIuFASTN /* see description */
#define PRIxFASTN /* see description */
#define PRIXFASTN /* see description */
#define SCNdFASTN /* see description */
#define SCNiFASTN /* see description */
#define SCNoFASTN /* see description */
#define SCNuFASTN /* see description */
#define SCNxFASTN /* see description */
#define PRIdMAX /* see description */
#define PRIiMAX /* see description */
#define PRIoMAX /* see description */
#define PRIuMAX /* see description */
#define PRIxMAX /* see description */
#define PRIXMAX /* see description */
#define SCNdMAX /* see description */
#define SCNiMAX /* see description */
#define SCNoMAX /* see description */
#define SCNuMAX /* see description */
#define SCNxMAX /* see description */
#define PRIdPTR /* see description */
#define PRIiPTR /* see description */
#define PRIoPTR /* see description */
#define PRIuPTR /* see description */
#define PRIxPTR /* see description */
#define PRIXPTR /* see description */
#define SCNdPTR /* see description */
#define SCNiPTR /* see description */
#define SCNoPTR /* see description */
#define SCNuPTR /* see description */
#define SCNxPTR /* see description */