I'm trying to compile this C++ code:
#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;
}
}
But I'm getting the error "C2144: syntax error : 'int' should be preceded by ';'"
And I can't understand why, because #define
doesn't need ';'
at the end.
I encounted this issue. I wrote a header file, but I forgot to add ";" at the tail of a function declaration. So, there is a error in my c file which is include this header file. I add comment here, and hope it will be useful for someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With