“C++字符类型!”
#include <iostream>
int main() {
int fuzhi=-256;
while (fuzhi<=256) {
unsigned char a=fuzhi;
int aa=a;
std::cout<<fuzhi<<" to "<<a<<std::endl;
fuzhi=fuzhi+1;
}
return 0;
}
参考资料:
- 《C++程序设计》第6版 · 周霭如 林伟健 徐红云编著
“C++字符类型!”
#include <iostream>
int main() {
int fuzhi=-256;
while (fuzhi<=256) {
unsigned char a=fuzhi;
int aa=a;
std::cout<<fuzhi<<" to "<<a<<std::endl;
fuzhi=fuzhi+1;
}
return 0;
}
参考资料: