我正在尝试编译这个 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
不需要';'
。