意外令牌附近的语法错误'('在C 7中[重复]

时间:2021-09-16 02:05:32

This question already has an answer here:

这个问题在这里已有答案:

I am having problem with the following code

我遇到以下代码的问题

#include <stdio.h>

int main()
{
    int tall = 175;
    int weight = 68;

    printf("I am %d slim.\n", tall);
    printf("I am %d kilogram.\n", weight);

    return 0;
}

i have created these code following a course but i have an issue (The Compiler said that )

我已经在课程后创建了这些代码,但我有一个问题(编译器说)

./file.c: line 3: syntax error near unexpected token `('
./file.c: line 3: `int main()'

for more information I am using GCC in linux destro .. and i am using terminal To run ... there's No IDE

更多信息我在linux destro中使用GCC ..我正在使用终端运行...没有IDE

1 个解决方案

#1


2  

It seems that you are not compiling your program, but that you are trying to execute it without compiling. The errors that you see is /bin/bash that tries to interpret this as shell code.

您似乎没有编译您的程序,但是您试图在不编译的情况下执行它。您看到的错误是/ bin / bash尝试将其解释为shell代码。

#1


2  

It seems that you are not compiling your program, but that you are trying to execute it without compiling. The errors that you see is /bin/bash that tries to interpret this as shell code.

您似乎没有编译您的程序,但是您试图在不编译的情况下执行它。您看到的错误是/ bin / bash尝试将其解释为shell代码。