I'm using this inside a Header File:
typedef struct
{
int DefaultValue;
}SetValues;
extern volatile SetValues XronosTrofodosias;
And this inside my Source file:
volatile SetValues XronosTrofodosias;
int *DefaultValuesWaterSubMenu[]={XronosTrofodosias.DefaultValue};
Why i get this error? How can i fix that?
Here is my Real String
int *DefaultValuesWaterSubMenu[]={XronosTrofodosias.DefaultValue,XronosAdranias.DefaultValue,XronosTrofodosiasHighTemp.DefaultValue,Xronos1hsRipsis.DefaultValue,Xronos2hsRipsis.DefaultValue,Kathisterisi2hsRipsis.DefaultValue,Energopoihsi2hsRipsis.DefaultValue,0,XronosAnemistiraOn.DefaultValue,XronosAnemistiraOff.DefaultValue,AnamoniAnemistira.DefaultValue,AdraniaAisthitiraFloagas.DefaultValue,StrofesAnafleksis.DefaultValue,AnoOrioAisthitiraFloagas.DefaultValue,KatoOrioAisthitiraFloagas.DefaultValue,EnergopohisiAisthitiriou.DefaultValue,OrioThermokrasiasKausaerion.DefaultValue,OrioThermokrasiasNerou.DefaultValue,KathisterisiAnemistira.DefaultValue,EnergopoihsiEksanemismou.DefaultValue,DiarkiaEksanemismou.DefaultValue,0,StrofesKausisAnemistira.DefaultValue,ThermokrasiaEkkinisisKikloforiti.DefaultValue,AnoOrioThermokrasiasNerou.DefaultValue,KatoOrioThermokrasiasNerou.DefaultValue,AnoOrioThermokrasiasKausaerion.DefaultValue,KatoOrioThermokrasiasKausaerion.DefaultValue};
You are trying to initialize the array with values which are unknown at compile time which makes them non-constant.
Also the array contains elements of type int* and you are trying to initialize it with values of type int.
A fix to the first problem would be to initialize each element separately:
A fix to the second porblem would be to change the array to contain int values
Or