【发布时间】:2021-03-24 08:58:27
【问题描述】:
当我运行这个基本的 C 程序时,它没有显示正确的输出。我用 VS Code 编写的每个程序都会发生这种情况。这是 VS Code 还是其他问题。我才刚刚开始。
代码
#include<stdio.h>
int main() {
printf("hello world");
return 0;
}
错误
PS C:\Users\Dev\Documents\Prog vsc> cd "c:\Users\Dev\Documents\Prog vsc\" && gcc hello world.c -o hello world && "c:\Users\Dev\Documents\Prog vsc\"hello world
At line:1 char:39
+ cd "c:\Users\Dev\Documents\Prog vsc\" && gcc hello world.c -o hello world && "c: ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:75
+ cd "c:\Users\Dev\Documents\Prog vsc\" && gcc hello world.c -o hello world && "c: ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:78
+ cd "c:\Users\Dev\Documents\Prog vsc\" && gcc hello world.c -o hello world && "c: ...
+ ~~~
Expressions are only allowed as the first element of a pipeline.
At line:1 char:112
+ ... ents\Prog vsc\"hello world
+ ~~~~~
Unexpected token 'hello' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
【问题讨论】:
-
那些不是 C 错误;它们似乎是您的 shell / IDE / 系统中的错误。
标签: c visual-studio-code compiler-errors