What is the difference between unsigned char and byte data types?

What is the difference between unsigned char and byte data types?
They are both a number from 0 to 255

Attached: CQapmmkVEAAreKg.jpg (600x320, 20.9K)

Other urls found in this thread:

stackoverflow.com/questions/20024690/is-there-byte-data-type-in-c
doc.rust-lang.org/std/#primitives
twitter.com/SFWRedditVideos

do you mean std::byte?

You don't know what byte data type is?
lol

there is no byte data type
rofl

A simple google proves you wrong buddy

I suppose it's only by convention that a char is always 8 bits long. Maybe one day, the "char" might be synonymous with some 64-bit unicode monstrosity. Remember: ASCII is our ancestral land.

If i remember correctly char is actually defined as size of one machine native word, which is byte on x86(_64).

...

stackoverflow.com/questions/20024690/is-there-byte-data-type-in-c
stop being retarded now

yea, whatever, you probably never coded in your life

What about Rust?

Let's see what Common Lisp has to say about it.

Just to add on some trivia. LISP Machines didn't actually support a byte datatype. Everything was done in words (eg. 36 bits on the 3600 or 40 bits on the Ivory). Thing like strings were done like arrays and multiple characters were packed into a single word.

What? Would you prefer the nonstandard u8 typedef?

The absolute state of this 'technology' board.

Attached: pathetic.jpg (500x625, 47.77K)

type Byte is mod 8;A: Byte := 7;beginA: A+1;Put_Line(A'Image);end;
= 0

One is burned the other bites.

nowadays practically speaking there's no difference, but on some exotic platform char might be more than one byte. Sizes of types in c/c++ like char short and int are platform specific. If you want guaranteed size you have to use uintx_t (where x is the number of bits) but these types might not be implemented on all platforms.
In other words, other than some piece of trivia, a char is a byte today.

no. in C char is one byte on all platforms. It isn't platform defined.

POSIX requires it to be eight bits. The C standard doesn't seem to put any requirements on it besides being an integer capable of containing the basic character set.

Can you name one architecture that uses a 7-bit register?

8 bit byte became standard in the 60s or there about so you have to go back to around these times to find such machines. The computer that was on Apollo mission used 15bit words.

While those are historically fascinating, they do not concern the discussion. Modern hardware addresses 8 bits minimum. This limitation by the hardware available in effect forces the standard to define char as 1 byte. Until 7-bit hardware starts showing up, it is a moot point to argue about such things.

This sub-discussion went roughly like this:

Do those exotic hardware exist?

Of course.

Attached: Screenshot from 2018-06-06 10-49-13.png (717x917 163.04 KB, 45.89K)

DSP's are weird. That's an arch that addresses other than 8 bits. Took long enough for someone to find a modern example.

It took seven minutes from the moment someone first asked for an example. I found it by entering something like "c char size architecture" into a search engine and clicking two links.

Boy, was I disappointed to realize that char was unsigned by default on ARM.

doc.rust-lang.org/std/#primitives

I like how char is still 1 byte, but it is also 1 word.