Ok a silly question. I am pretty sure that is preferable to use const to declare constants rather than define which just replaces the text on your code with the corresponding label but I was wondering why in a header file of mine where I declare my const it doesnt let me use them for arrays in some structs i made
i.e
Code:
const int BODY_SIZE = 251;
const int BUFFER_SIZE = 256;
const int LOGIN_NL = 16;
const int ERROR = -1;
const int SUCCESS = 0;
const int SEND = 1;
const int READ = 2;
char buf[BUFFER_SIZE];
typedef struct mail{
char sender[LOGIN_NL];
char receiver[LOGIN_NL];
char text[BODY_SIZE];
struct mail* next;
}mail;
the compiler says
error: variably modified β...β at file scope
Any help