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

  • Home
  • SEARCH
  • 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 1049147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:34:11+00:00 2026-05-16T16:34:11+00:00

Possible Duplicate: Why are C character literals ints instead of chars? Why when using

  • 0

Possible Duplicate:
Why are C character literals ints instead of chars?

Why when using C does sizeof('x') return 4 but sizeof('x') in C++ returns 1?

C++ normally strives to be nothing more than a superset of C so why do the two results diverge?

Edit
Just some further clarification. This seems like a deliberate move on the part of the standards committee and I assume changing the size of ‘x’ would not have been done without a good reason. I am interested in what the reason is.

  • 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-16T16:34:11+00:00Added an answer on May 16, 2026 at 4:34 pm

    To quote the C++ standard ISO 14882:2003, annex C.1.1 clause 2.13.2

    Change: Type of character literal is changed from int to char

    Rationale: This is needed for improved overloaded function argument type matching. For example:

    int function( int i );
    int function( char c );
    function( ’x’ );
    

    It is preferable that this call match the second version of function rather than the first

    (annex C describes the incompatibilities between C and C++)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 509k
  • Answers 509k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can start the screen saver by sending a windows… May 16, 2026 at 4:37 pm
  • Editorial Team
    Editorial Team added an answer A SystemSoundID is a integer value, not an object; and… May 16, 2026 at 4:37 pm
  • Editorial Team
    Editorial Team added an answer Found the answer in the details of mod_include: The below… May 16, 2026 at 4:37 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Possible Duplicate: The ‘:’ character, hexadecimal value 0x3A, cannot be included in a name
Possible Duplicate: Unicode in C++ If I remembered correctly, the default character and string
Possible Duplicate: Last but one Char in vb.net String How do I find the
Possible Duplicate: How does one escape characters in Delphi string In Delphi a string
Possible Duplicate: Qt equivalent of PathAppend? Short story: does Qt 4 have an analog
Is it possible to remove duplicate characters from a string without saving each character
Possible Duplicate: Why is my return type meaningless? Hi, I'm confused about a particular
Possible Duplicate: Multiline strings in Javascript In Ruby you can do something like this:
Possible Duplicate: Why is this C code causing a segmentation fault? char* string =
Possible Duplicate: Why do I get a segmentation fault when writing to a string?

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.