设置编码区域与设置输出代码页

来源:互联网 发布:好听的淘宝零食店名字 编辑:程序博客网 时间:2024/05/16 10:50
int main(){ setlocale( LC_ALL, ".437" ); //设置编码区域 SetConsoleOutputCP(437);     //设置输出代码页 char *a ="123"; char b[4]; b[0] = ~a[0]; b[1]=~a[1]; b[2] = ~a[2]; b[3]='\0'; string str=b; str =str+"'"; cout<<str<<endl; cout<<b[0]<<"  "<<b[1]<<"  "<<b[2]<<endl; cout<<b<<endl; cout<<GetConsoleOutputCP();   //得到输出代码页 getchar(); return 1;}


 

原创粉丝点击