Why char is not taken as numeral in C++?
问题 I wrote a code in C, which ran perfectly, I translated it to C++ . There it was giving wrong output. I had an iteration where I used both the input and the iterator variable as char to save space. But didn't behaved as expected. unsigned char repeat, i; cin >> repeat; for(i= 0; i < repeat; i++) What is the equivalent line for scanf("%hhi", &repeat) ? 回答1: Why char is not taken as numeral in C++? Because C and C++ are different programming languages. See for example n3337, a draft C++ standard