I try to declare the following class in C++; however, I have gotten the following error. Is there something wrong with pointers?
class classFather{
public:
int BmcCommand;
int BmcDataLength;
byte BmcDataBuffer[];
classFather() {
BmcCommand = 0;
BmcDataLength = 0;
BmcDataBuffer = new byte[CMD_LENGTHH];
}
classFather(byte s8Command, int siLength, byte as8Data[]) {
BmcCommand = s8Command;
BmcDataLength = siLength;
int size = sizeof( as8Data ) / sizeof( as8Data[0] );
BmcDataBuffer = new byte[size];
for(int ii=0; ii< size; ii++)
BmcDataBuffer[ii] = as8Data[ii];
}
private:
static const short CMD_LENGTHH = 255;
};
I'm getting the following error:
error: incompatible types in assignment of `byte*' to `byte[0u]'
C:\....\BluetoothClient\/msgCAN.h: In constructor `msgCANFather::msgCANFather(byte, int, byte*)':