0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

c++ builder > 2進数リテラル (0b11) > XE4では未対応のようだ

Last updated at Posted at 2016-08-18
動作環境
C++ Builder XE4

関連 http://qiita.com/7of9/items/eae06dfd76e15ee2ca7c

0b11という表記でエラーが出ている。

stackoverflowで質問したところ、以下のような回答をいただいた。

by Kerem D
If you want to compile this, you will need a newer version of the C++ Builder with a C++11 compiler.

「0b c++11」などで検索して以下を見つけた。

C++14から、2進数リテラルが言語組み込みで導入されることが決まりました。
0bもしくは0Bというプレフィックスを付けたあとに、0か1のシーケンスを記述します。

2進数リテラルとは、C++14に追加された新しい整数リテラルである。その文法と意味は、文章で解説するよりも、コードを読んだほうが理解が早いだろう。

XE4では対応してないようだ。

stackoverflowにてRemy Lebeauさんの回答もついた。その一部。

The current C++Builder compilers support only decimal, octal, and hex. See Embarcadero's documentation for details: Integer Constants

「Integer constants」というキーワードで検索すればよかったようだ。
Visual Studioのページ

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?