gpt4 book ai didi

C++-错误C2144语法错误: 'int' should be preceded by ';'

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:07:27 25 4
gpt4 key购买 nike

<分区>

我正在尝试编译此 C++ 代码:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "general_configuration.h"
#include "helper_functions.h"

#define LINE_LEN 80

// file_with_as_ext returns 1 if the input has .as extension
int file_with_as_ext(char* input)
{
char* dot_value = strchr(input, '.');
if (dot_value == NULL)
return 0;
else
{
if (strcmp(dot_value,".as") == 0)
return 1;
}
}

但我收到错误 "C2144: syntax error : 'int' should be preceded by ';'"

我不明白为什么,因为 #define 最后不需要 ';'

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com