i want to create a function(in a project) that returns an array. I m not quite sure about how can i do that.
int worker::*codebook(UnitType type){
int code[12];
if (type == UnitTypes::center){
int temp[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
code=temp;
}
return code;
}
where worker
is the class and unitType
an enumeration. I define the function in the header file as follows:
int *codebook(UnitType type);
My problems is the following:
cannot convert from 'int' to 'int Worker::*
Any idea about this??