((First C Program / Hello World)不断出现语法错误

问题描述 投票:1回答:2

这是我当前的代码:

#include <stdio.h>

void print_hello() {
    printf("Hello n10321234, welcome to BSB211");
}

int main() {
    print_hello();
    return 0;
}

但是在编译并运行.exe时,我始终收到以下错误:

./ print_hello:第3行:意外令牌(']附近的语法错误

./ print_hello:第3行:`void print_hello(){'

对于编译,我使用了gcc print_hello.c -o print_hello,运行时我使用了./print_hello

这是我当前的代码:#include void print_hello(){printf(“ Hello n10321234,欢迎使用BSB211”); } int main(){print_hello();返回0; }但是我不断得到...

c
2个回答
0
投票

0
投票
© www.soinside.com 2019 - 2024. All rights reserved.