Type of character constant

Viewed 1938

I am studying physics and in the lecture notes of our programming course it is written that a character constant, in C has type char, where by character constant I mean an expression like 'x'. After asking my lecturer if that was a mistake he said no. After showing him the C90, C99 and C11, where it is clearly written that a character constant has type int he still didn't say it was a mistake.

So before asking him again I wanted to assure myself that I got it the right way, and why it is that way, because it seems like a waste of memory. Everything I found out about why it is that way, is that it is because of historic reasons, which is rather vague. Also I would like to know why in C++ , they changed the type of a character constant to char.

EDIT: thanks a lot for the answers.

3 Answers
Related