Octal Literals - C++ Data Type

C++ examples for Data Type:int

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

Demo Code

#include <iostream>

int main()/*from ww  w .ja  v a  2  s .co  m*/
{
    unsigned int a {0657};

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

Result


Related Tutorials