Home  >  Article  >  Development Tools  >  vscode compile c console output garbled code

vscode compile c console output garbled code

王林
王林Original
2020-02-13 13:11:363389browse

vscode compile c console output garbled code

Just change the encoding method of cmd or vscode. The specific method is as follows:

1. Enter the directory where the program is located and run the program. For example, my cpp program is in D:/c/test.exe:

2. After entering cmd, enter the following command:

D:    进入到驱动器
cd c    进入到 c 目录下
chcp 65001    转换编码方式
test.exe    运行程序

3. You can use the character encoding as utf-8 Next, the program will output Chinese.

vs code console:

chcp 65001
.\test.exe

Recommended related articles and tutorials: vscode tutorial

The above is the detailed content of vscode compile c console output garbled code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn