簡體   English   中英

如何修復錯誤:C 中的預期標識符 '('

[英]How Can I Fix the error: expected identifier '(' in C

我不明白我做錯了什么我已經搜索了幾個在線參考資料,但仍然無法弄清楚我做錯了什么。 這是我的代碼

#include <cs50.h>
#include <stdio.h>

int x = 5;

int y=get_int("ENTER DIGIT HERE\n");

if (x>y) {
    printf("HI\n");

}else{
    printf("BYE\n");
} 

基本上你想要這個:

#include <cs50.h>
#include <stdio.h>

int main(void)   // <<<< your code must be in the main function
{
   int x = 5;

   int y=get_int("ENTER DIGIT HERE\n");

   if (x>y) {
     printf("HI\n");
   } else {
     printf("BYE\n")
   }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM