Below I've presented the declaration, definition and the calling method of a function w.r.t pass by reference:
Declaration
Code:
void getUnpackedMsg (unsigned char &data, unsigned int numberOfBits);
Definition
line 278: Shown in RED
Code:
void packedMessage :: getUnpackedMsg (unsigned char &emptyArray, unsigned int numberOfBits)
{
...
...
printf ("\nAfter unpacking 0: %d ", emptyArray[0]);
}
Calling
Code:
q.getUnpackedMsg (*empty0, 8);
Error Messages:
Code:
workingA.cpp:278: error: invalid types ‘unsigned char[unsigned int]’ for array subscript
Kindly point me the error here !
P.S.
By Mistake I have posted this in C forum, It should go to C++ forum. How to inform the moderator now ?