By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Web Developer" <no****@hotmail.com> wrote in message
news:3f**********@news.iprimus.com.au...
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
Jul 19 '05 #2

P: n/a

"John Harrison" <jo*************@hotmail.com> wrote in message
news:bg************@ID-196037.news.uni-berlin.de...

"Web Developer" <no****@hotmail.com> wrote in message
news:3f**********@news.iprimus.com.au...
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
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.