473,395 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
2 3088

"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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: copx | last post by:
For some reason Python (on Windows) doesn't use the system's default character set and that's a serious problem for me. I need to process German textfiles (containing umlauts and other > 7bit...
0
by: marko | last post by:
How to convert 8bit numbers to 7bit numbers? Thanks, Marko
2
by: Peter Nilsson | last post by:
In a post regarding toupper(), Richard Heathfield once asked me to think about what the conversion of a char to unsigned char would mean, and whether it was sensible to actually do so. And pete has...
15
by: T Koster | last post by:
Hi group, I'm having some difficulty figuring out the most portable way to read 24 bits from a file. This is related to a Base-64 encoding. The file is opened in binary mode, and I'm using...
7
by: d.kaufmann | last post by:
i have this part of code: typedef enum { OW_SEARCH_ROM = 0xF0, OW_MATCH_ROM = 0x55, OW_CONDITIONAL_SEARCH_ROM = 0xEC, OW_HANDLE_SELECT = 0x0F } ow_command_t;
7
by: Lance | last post by:
Is there any way to create an import alias that applies to the entire project? For example, lets say that I want "VB" to represent Microsoft.VisualBasic throughout my entire project. Is there...
2
by: Mark Olbert | last post by:
I want to bind a series of ObjectDataSource instances to an application-wide business object which caches the results of a database query. I'm confused about where/how to cache the results (it's...
8
by: poodles | last post by:
I'm trying to find out the ranges of different data types through direct computation........this is what I did....... Code: #include <stdio.h> main() { char ch; signed short sh;
3
by: diadomraz | last post by:
Hi, This is a question about declaring a signed 8bit numeric type in C++ that prints like a numeric variable and not like a char variable. I would like to declare a type with name 'byte' which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.