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 con
Speaking from experience, when C was young, it was simpler for expressions to work mostly in int. The early compilers were much less complicated than today’s compilers. Additionally, programming languages generally were not as strongly typed as they are today.
It is not a waste of memory for character constants to have type int, because the C standard does not specify how they have to be kept in memory. Only objects, such as one declared with int d; must be assigned memory (and even then often only in the abstract computation model of C, not necessarily in the real computer). A C implementation may introduce the value of a character constant to the instructions that execute the program in any way it pleases, as long as the result is correct. E.g., it can store the value in a few bits of an immediate field in an instruction, without using all the space anint requires.
I expect C++ changed the type of character constants to char because it is moving toward stronger typing, with the aim of reducing human errors.