Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6206433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:26:59+00:00 2026-05-24T05:26:59+00:00

Zero is always zero, so it doesn’t matter. But in a recent discussion with

  • 0

Zero is always zero, so it doesn’t matter. But in a recent discussion with a friend he said that octal literals are almost unused today.† Then it dawned upon me that actually almost all integer literals in my code are octal, namely 0.

Is 0 an octal literal according to the C++ grammar? What does the standard say?

† The only real use I’m aware of is for unix file permissions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:27:00+00:00Added an answer on May 24, 2026 at 5:27 am

    Yes, 0 is an Octal literal in C++.

    As per the C++ Standard:

    2.14.2 Integer literals [lex.icon]

    integer-literal:  
        decimal-literal integer-suffixopt  
        octal-literal integer-suffixopt  
        hexadecimal-literal integer-suffixopt  
    decimal-literal:  
        nonzero-digit  
        decimal-literal digit  
    octal-literal:  
        0                           <--------------------<Here>
        octal-literal octal-digit
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why is the heap space always set to zero?? Why is stack space similarly
I have zero experience writing applications with Swing, but I have one application with
image naturalWidth return zero... that's it, why ? var newimage = new Image(); newimage.src
I'm trying to get a call to EnumThreadWindows working, but I always get a
Using ActiveRecord, I have an object, Client, that zero or more Users (i.e. via
p1.username always has a value that's foreign to VB_user table. The problem is that
Does zero-day or 0-day (in context of software vulnerabilities and exploits) refer to the
CF: Carry Flag ZF: Zero Flag i'm current read a book on intel x86
I have zero experience with COM. I actually never thought, I'll need to do
I know zero javascript, and have one simple task: Find all text in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.