c++ - expression must have pointer-to-object type,subscript requires array or pointer type -
class rc5 { public: rc5() : _bufkey(new unsigned __int32[4]), _bufsub(new unsigned __int32[26]) { } unsigned __int8 test(unsigned __int8 data); virtual ~rc5() { delete [] _bufkey; delete [] _bufsub; } private: unsigned __int32 *const _bufkey; unsigned __int32 *const _bufsub; }; unsigned __int8 rc5::test(unsigned __int8 data) { (int = 0; < 4; i++) { _bufkey[i] = (unsigned __int32)(data[i * 4] + (data[i * 4 + 1] << 8) + (data[i * 4 + 2] << 16) + (data[i * 4 + 3] << 24)); } }
i got errors : expression must have pointer-to-object type,subscript requires array or pointer type
it looks problem in test function you're passing in data unsigned __int8 rather array of these values. subscripting square brackets what's causing error. changing function take it's value array should fix this.
Comments
Post a Comment