hi everyone,
The following is a class in my code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class cBSR
{
public:
cBSR(enum Timer_Len a = sf5,enum Timer_Len b = sf320); //Constructor
void fBufferStatus(int *); // Return type remaining check***
void fCompare(void);
private:
int periodic_Timer_Len;
int retx_Timer_Len;
int highest_priority;
struct BSRlist {
int LCG_ID;
int LCG_priority;
int buffer_data;
//struct BSRlist *next;
}Temp_list[4],Final_list[4];
};
and the constructor is:
1 2 3 4 5 6 7 8 9 10 11 12
cBSR::cBSR(enum Timer_Len a = sf5,enum Timer_Len b = sf320) //Constructor
{
periodic_Timer_Len=a;
retx_Timer_Len=b;
for(int i=0;i<4;i++)
{
BSRlist Temp_list[i]={-1,-1,-1};
BSRlist Final_list[i]={-1,-1,-1};
}
highest_priority=-1;
//many more functions to be called
}
Its showing an error
attempt3.cpp:38:33: error: variable-sized object ‘Temp_list’ may not be initialized
attempt3.cpp:39:34: error: variable-sized object ‘Final_list’ may not be initialized
Please help.I have specified that Final_list/Temp_list are arrays of 4 structure respectively still its showing the same problem