Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.12 KB

uint8_max.md

File metadata and controls

48 lines (36 loc) · 1.12 KB

UINT8_MAX

  • cstdint[meta header]
  • macro[meta id-type]
  • cpp11[meta cpp]
# define UINT8_MAX implementation-defined

概要

uint8_t の最大値を表す定数。

ビット数8をNとして、このマクロの値は2N - 1である255となる。

その値の型は、uint8_tを整数昇格したものとなる。

なお、このマクロは uint8_t が定義されていない場合には定義されない。

#include <iostream>
#include <cstdint>

int main()
{
  std::cout << UINT8_MAX << std::endl;
}
  • UINT8_MAX[color ff0000]

出力

255

Visual C++では、static_cast<int>(UINT8_MAX)としないと、このとおりに出力されない。

バージョン

言語

  • C++11

処理系