Home C++ Decisions Loops Input/Output Functions Stack and Heap References Arrays Searching and Sorting Recursion Pointers Character and Strings Structures Classes Inheritance Exceptions Templatess STL Modern C++ Misc Books ----

C++ 14


Contents

Binary Literals

This feature allows us to use integeral values written in binary form.

File: bin1.cpp
#include <iostream>

using namespace std ;

int main()
{
  int x1 = 0b100 ;// == 4
  int x2 = 0b1111'1111  ; // == 255
  cout << "x1:" << x1 << endl ;
  cout << "x2:" << x2 << endl ;
}