I think the compiler is actually complaining that you’re trying to write C by trial and error and would probably suggest you read a book about the basics of C, but it is too polite...
What you wrote in line 8 has no meaning in C. You can only initialize variables (your array in this case) with constants whose values are known at compile time. You are using variable names instead and that makes no sense. Even if it worked you would actually allocate two times the storage needed for your variables.
I’m not sure what your intention was originally, but here are 2 ways of rewriting that:
Code:
char *now_clock[]={&now_sec, &now_min, &now_hr, &now_day, &now_weekday, &now_month, &now_year};
or:
Code:
union
{
char init[7]; // use this to initialize the clock in a for loop
struct
{
char now_sec;
char now_min;
char now_hr;
char now_day;
char now_weekday;
char now_month;
char now_year;
};
}now_clock;
Your homework is to find out what these cases mean and how they apply to your need.
Arthur