Doubt about char.min/max == typeid(char)

matheus matheus at gmail.com
Fri Oct 7 00:13:59 UTC 2022


Hi,

Could anyone please tell me why the properties of min/max of a 
char returns a "char type" and not a value as an int?

I just got this while playing around:

void main(){
     import std.stdio;
     writeln(char.max); // "nothing"
     writeln(typeid(char.max)); // "char"
     writeln(cast(int)char.max); // 255
}

Thanks in advance,

Matheus.


More information about the Digitalmars-d-learn mailing list