Domanda

I just have a question to make sure I get something well.

If I used my computer to sum 10+11 which is 21, it will store 21 in usually a byte such that 0001 0101, however, when it prints it on the screen, it will actually represent it as two digits 2 (0110010) and 1 (0110001) appended to each other to form 21) using ASCII.

Is that right?

Thank you!

È stato utile?

Soluzione

That is correct.

The representation of characters in a simple terminal is ASCII, where each character is represented by a (technically 7-bit) code.

Some terminals support more complex encodings like UTF8, but since UTF8 is backwards compatible with ASCII you need not worry about it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top