codeblocks控制台输出中文输出乱码

 

printf("你好,世界");

在写C语言的时候打印汉字,输出的时候会出现乱码。

 

同时codeblocks右下角会出现一个提示:

the saved document contained characters which were illegal in the selected encoding. the file is encoding has been changed to utf-8 to prevent you from losing data.

原因:在网上搜索了一下,应该是汉字编码的问题。但是给出的方法我用没好使。

解决办法:Settings ->Editor ->Encoding settings ->Encoding项,改成default就可以了。如果还是不行,可以尝试其他编码

PS:刚开始写博客,还不太会,不知道为什么总是有两行代码行,不会删除,读的时候忽略吧 :)

你可能感兴趣的:(C语言)