C++ int type Octal Literals

Introduction

You can write integer literals as octal values with base 8.

You mark a number as octal by writing it with a leading zero.

Octal literals: 0657 0443U 012L 06255 0377
Decimal literals: 431 291U 10L 3245 255
#include <iostream>

int main()//w ww .  j av  a2s. c  om
{
    unsigned int a {0657};

    std::cout << "The value of a is "  << a  << std::endl;
}



PreviousNext

Related