N
nsgi_2004
I have a C book that says the sizeof a char is one byte. Is this true for
C++?
C++?
nsgi_2004 said:I have a C book that says the sizeof a char is one byte. Is this true for
C++?
nsgi_2004 said:I have a C book that says the sizeof a char is one byte. Is this true for
C++?
I have a C book that says the sizeof a char is one byte. Is this true for
C++?
nsgi_2004 said:I have a C book that says the sizeof a char is one byte. Is this true for
C++?
Michiel said:Yes, because C++ redefines byte to mean the size of a char. It's not
always the 8-bit thingy you might expect. This is shared between C
and C++, It's relevant e.g. for some DSP chips inside cellphones
that have 32 bits per byte. Now, those are programmed in C not C++,
but C++ felt no need to differ from C here. If anyone writes a
C++ compiler for such things, they can still use the same 32-bit
char.
Regards,
Michiel Salters
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.