In this article, we will discuss Binary literals in C++14.
While writing programs which involve mathematical evaluations or various types of number, we usually like to specify each digit type with specific prefix i.e., For Hexadecimal number use the prefix ‘0x’ and for Octal number use the prefix ‘0’. Below is the program to illustrate the same:
Binary Literals: In the above way like in hexadecimal and octal numbers, now we can directly write binary literals (of the form 0’s and 1’s) in C++14. The binary number can be expressed as 0b or 0B as the prefix. Below is the program to illustrate the same: