I was trying to write the code as follows:
In header file: test.h
#define size_aspid 8
const char replace_aspid[20];
void print_max_length();
In test.c file:
const char replace_aspid[] = "replace_aspidiii";
int max_size = size_aspid+strlen(replace_aspid);
void print_max_lenght()
{
printf("Max length is: %d\n",max_size);
}
In main.c file:
int main()
{
print_max_length();
return 0;
}
Then the compiler says the following:
warning: initializer element is not a constant expression
#define size_aspid 8
note: in expansion of macro ‘size_aspid’
int max_size = size_aspid+strlen(replace_aspid);
where i am going wrong. Thanks!!!!!!!!!!!