Error defining char

2

I have this simple code of a Header File and I get 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'm a beginner in C, and it's a pretty simple code but I do not know why defining the type char gives me syntax error.

    
asked by RoyalUp 27.04.2016 в 18:48
source

1 answer

3

When compile your header gives me this error:

prog.c:7:14: error: expected ']' before ';' token
 #define N 129;
              ^

Then the solution would be to take out that ; of #define

#define N 129

Note that the pre-processor directives (such as #define, #ifndef, etc) do not carry; at the end since it is not C or C ++ syntax

    
answered by 27.04.2016 / 19:02
source