I have this simple code for a Header File and it gives me an error when defining this:
typedef char Cadena[N];
and my code is this:
/* cadenas.h */
#ifndef CADENAS_H_
#define CADENAS_H_
#include <stdio.h>
#include <string.h>
#define N 129;
typedef enum{FALSO,CIERTO} Logico;
typedef char Cadena[N];
int buscaCaracter(const Cadena cad,char c);
Logico esPalindromo(const Cadena cad);
#endif /* CADENAS_H_ */
I am a beginner in C , and it is a fairly simple code but I don't know why when defining the type char it gives me a syntax error.
Compiling your header gives me this error :
So the solution would be to remove that
;
from the#define
Note that pre-processor directives (like #define, #ifndef, etc) do not have ; at the end since it is not C or C++ syntax