char 8bit wide or 7bit wide in c++?

Discussion in 'C++' started by Web Developer, Jul 31, 2003.

  1. Hi,

    Have a book that says a char in c++ is 8bit wide. But i remember reading
    that C++ uses ANSI character set which uses 7bit per character. Who is
    right?


    WD


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003
    Web Developer, Jul 31, 2003
    #1
    1. Advertising

  2. "Web Developer" <> wrote in message
    news:3f28c7ab$...
    > Hi,
    >
    > Have a book that says a char in c++ is 8bit wide. But i remember reading
    > that C++ uses ANSI character set which uses 7bit per character. Who is
    > right?
    >


    Neither. In fact every statement about C++ above is wrong. Here's the truth.

    In C++ a byte must be at least 8 bits. A char must be a single byte.

    C++ does not use the ANSI character set (maybe you mean ASCII?), it might,
    but it does not have to, it could use a completely different character set.

    Even if C++ did use a seven bit character set, then it would do so in a
    eight bit character (probably) and just ignore the extra bit.

    john
    John Harrison, Jul 31, 2003
    #2
    1. Advertising

  3. "John Harrison" <> wrote in message
    news:bgaima$mkb10$-berlin.de...
    >
    > "Web Developer" <> wrote in message
    > news:3f28c7ab$...
    > > Hi,
    > >
    > > Have a book that says a char in c++ is 8bit wide. But i remember reading
    > > that C++ uses ANSI character set which uses 7bit per character. Who is
    > > right?
    > >

    >
    > Neither. In fact every statement about C++ above is wrong. Here's the

    truth.
    >


    What's the book BTW?

    john
    John Harrison, Jul 31, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. marko

    8bit to 7bit numbers

    marko, Aug 23, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,159
    marko
    Aug 23, 2003
  2. Daniel Roth

    7bit to 8bit

    Daniel Roth, Apr 15, 2004, in forum: Python
    Replies:
    3
    Views:
    1,479
    Peter Hansen
    Apr 15, 2004
  3. humble
    Replies:
    0
    Views:
    889
    humble
    Oct 28, 2006
  4. lovecreatesbeauty
    Replies:
    1
    Views:
    1,034
    Ian Collins
    May 9, 2006
  5. Irene
    Replies:
    0
    Views:
    226
    Irene
    May 1, 2004
Loading...

Share This Page