R
ravinderthakur
hi all experts,
i have a structure with the constant memebers such as one given below:
typedef struct {
const int cbcode;
int cberror;
} xtsetplatestaterec;
now in my function i want to create a stack based object for the same:
void CreateObjectAndUseIt{
xtsetplatestaterec plate;
xtsetplatestaterec plate2 = {0 , 0};
}
now this function is giving the compilation errors while compiling on
vc++ 6.0 since the
cbcode memeber is a constant. the error is
error C2512: 'xtsetbleedvaluesrec' : no appropriate default constructor
available
error C2552: 'tmpsetplatestaterec' : non-aggregates cannot be
initialized with initializer list
can anybody plz explain me what could be done to create instances of
these objects on stack ???
thanks
rt
i have a structure with the constant memebers such as one given below:
typedef struct {
const int cbcode;
int cberror;
} xtsetplatestaterec;
now in my function i want to create a stack based object for the same:
void CreateObjectAndUseIt{
xtsetplatestaterec plate;
xtsetplatestaterec plate2 = {0 , 0};
}
now this function is giving the compilation errors while compiling on
vc++ 6.0 since the
cbcode memeber is a constant. the error is
error C2512: 'xtsetbleedvaluesrec' : no appropriate default constructor
available
error C2552: 'tmpsetplatestaterec' : non-aggregates cannot be
initialized with initializer list
can anybody plz explain me what could be done to create instances of
these objects on stack ???
thanks
rt