欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

std::iscntrl

最编程 2024-01-12 21:20:03
...
#include <iostream> #include <cctype> #include <clocale> int main() { unsigned char c = '\x94'; // the control code CCH in ISO-8859-1 std::cout << "iscntrl(\'\\x94\', default C locale) returned " << std::boolalpha << (bool)std::iscntrl(c) << '\n'; std::setlocale(LC_ALL, "en_GB.iso88591"); std::cout << "iscntrl(\'\\x94\', ISO-8859-1 locale) returned " << std::boolalpha << (bool)std::iscntrl(c) << '\n'; }