Is “char” a special type of integer variable?

前端 未结 3 1122
没有蜡笔的小新
没有蜡笔的小新 2020-12-20 03:40

I recently came across a statement saying that \"char\" type in C is really a special form of integer – one that stores the ASCII code numbers which represent characters and

3条回答
  •  一向
    一向 (楼主)
    2020-12-20 04:15

    Yes, a char is (typically) a one-byte integer. Except the compiler knows to treat it differently, typically with ASCII character semantics. Many libraries / headers define a BYTE type that is nothing more than an unsigned char, for storing one-byte integers.

提交回复
热议问题