C++Builder > Binary Number 0b1 Causes Error E2141 - Stack Overflow
-
- Home
- Questions
- Tags
- Users
- Companies
- Labs
- Jobs
- Discussions
- Collectives
-
Communities for your favorite technologies. Explore all Collectives
- Teams
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Try Teams for free Explore Teams - Teams
-
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsGet early access and see previews of new features.
Learn more about Labs C++Builder > binary number 0b1 causes error E2141 Ask Question Asked 8 years, 3 months ago Modified 8 years, 3 months ago Viewed 1k times 1I am using C++ Builder XE4.
I am trying to use a binary number such as 0b1 in my code.
Following is the code I tried:
void __fastcall TForm1::Button1Click(TObject *Sender) { int num = 0b11; }The above causes a compiler error:
Unit1.cpp(19): E2141 Declaration syntax error
Does C++Builder support binary numeration like this?
I confirmed that 0x11 works in C++Builder.
I also confirmed that 0b11 can be used in IDEOne using C++:
http://ideone.com/oy4aIZ
Share Improve this question Follow edited Aug 18, 2016 at 0:59 Remy Lebeau 591k33 gold badges491 silver badges829 bronze badges asked Aug 17, 2016 at 9:54 sevenOfNinesevenOfNine 1,55418 silver badges39 bronze badges 1- 3 I'd guess the compiler simply doesn't support it. – Joey Commented Aug 17, 2016 at 10:04
2 Answers
Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 2Binary notation of integer literals is a new feature in C++14. However, no C++Builder version has a C++14 compiler at this time.
In XE4, the Win32 compiler and OSX compiler do not support C++11 at all (a 32bit C++11 compiler was added in 10.0 Seattle). The Win64 compiler supports C++11, though.
The current C++Builder compilers support only decimal, octal, and hex. See Embarcadero's documentation for details: Integer Constants
Share Improve this answer Follow answered Aug 18, 2016 at 1:19 Remy LebeauRemy Lebeau 591k33 gold badges491 silver badges829 bronze badges 1- Thank you all. I was trying to find this kind of information using google, but without success. Now I can find it using keyword "Integer Constants". I appreciate it. – sevenOfNine Commented Aug 18, 2016 at 2:13
If you want to compile this, you will need a newer version of the C++ Builder with a C++11 compiler.
Share Improve this answer Follow answered Aug 17, 2016 at 11:02 KeremKerem 4495 silver badges22 bronze badges 2- 2 In XE4, the Win64 compiler is a C++11 compiler, but the Win32 compiler and OSX compiler are not. – Remy Lebeau Commented Aug 18, 2016 at 1:11
- 2 However, according to this reference and this article, binary notation is new in C++14, not C++11. – Remy Lebeau Commented Aug 18, 2016 at 1:11
Your Answer
Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Draft saved Draft discardedSign up or log in
Sign up using Google Sign up using Email and Password SubmitPost as a guest
Name EmailRequired, but never shown
Post Your Answer DiscardBy clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Not the answer you're looking for? Browse other questions tagged
or ask your own question.- The Overflow Blog
- Your docs are your infrastructure
- Featured on Meta
- More network sites to see advertising test [updated with phase 2]
- We’re (finally!) going to the cloud!
- Call for testers for an early access release of a Stack Overflow extension...
Related
1 Borland C++: Ambiguity with std (error E2015) 0 Weird linker error on Borland C++ Builder 6 2 Borland C++ Builder compile error 0 Borland Warning 8092 7 c++ Builder xe5 Error detected (LME288) 1 C++ Builder E2303 Type name expected 1 E2316 in using std::function 0 C++ Builder [bcc32 Error] Unit1.cpp(18): E2040 Declaration terminated incorrectly 1 How to resolve Exception Error in C++ Builder 0 error in _bitset.h file header file: array must have at leas one elementHot Network Questions
- Groups with no proper non-trivial fully invariant subgroup
- Are there any examples of exponential algorithms that use a polynomial-time algorithm for a special case as a subroutine (exponentially many times)?
- Table tennis tournament scoreboard
- I am the owner of an image. I published it in Unsplash. Am I allowed to upload that same image to other sites?
- Weapon Mastery and Weapon Cantrips
- Reducing wattage of a portable car heater
- What is the polymorph reached by letting the chocolate cool down?
- Table structure with multiple foreign keys and values
- Polynomial.java - a Java class for dealing with polynomials with BigDecimal coefficients
- Is Isaiah's suffering servant the prophet Jeremiah?
- Is there a cryptographic method that can only decrypt for a certain range of seeds?
- Will a laptop battery that stays connected to its charger be damaged?
- Why didn't Steve Zahn receive a credit for Silo?
- How to say "Each one of the following" in German?
- Group cohomology valued in a bimodule
- Identifying a TNG episode where Dr. Pulaski instructs another doctor on a sling
- testing for a correlation between a real number and percentage accuracy
- How can I avoid overusing her/she or the character name when describing character action
- Do I need Letter of invitation to Iceland?
- What mechanism could cause a person not to cast a reflection?
- What is this Stardew Valley item?
- Shell Script to Normalize the data
- Clarification of notions regarding kinetic energy and kinetic theory of matter
- How to design for API use cases that need different data from the same table?
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Từ khóa » C 0b1
-
"You Must Write The Anwser In Binary Using The "0bxxx" Format."
-
4.15 — Literals - Learn C++
-
C0B1: Mobilum Technologies Inc Stock Price Quote
-
[PDF] B-0B1 C-0B1 D-0B1D D-0B1T
-
Short Chamfer Torqueless Roll Taps SC-TL-RZ (SRZM41.0B1)
-
Introducing C++14's Binary Literals, Digit Separators, And Variable ...
-
OE-Nummer 0B1 198 141 C: Find Products At Schaeffler
-
Image Layer Details - Tensorflow/tensorflow:2.0.0b1-gpu | Docker Hub
-
Image Layer Details - Esphome/esphome-hassio-armv7:2022.3.0b1
-
Simex SRD N16A, 8 Input Channels, 2 Output Channels, Graphical ...
-
OEM NUMBER 0B1198141C Clutch Kit - Car Parts - AUTODOC
-
Multichannel Data Logger MultiLog SRD-N16
-
2102N-0B1-BX - 2000 Series Compressed Air Filters | Parker NA