#include <stdio.h> #include <wctype.h> int main () { int i=0; wchar_t str[] = L"first line \n second line \n"; while (!iswcntrl(str[i])) { putwchar (str[i]); i++; } return 0; }
输出
first line
c 判断是否为非控制字符
原文:https://www.cnblogs.com/sea-stream/p/10823016.html