0
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)
{
for (int i = 0; i < 4; i++)
{
_bufKey[i] = (unsigned __int32)(data[i * 4] + (data[i * 4 + 1] << 8) + (data[i * 4 + 2] << 16) + (data[i * 4 + 3] << 24));
}
}
我得到這個錯誤:表達式必須具有指針到的對象類型,下標要求數組或指針類型表達式必須有指針到的對象類型,下標要求數組或指針類型
爲什麼不使用`std :: vector`? – GManNickG 2011-02-09 10:36:12
@GMan因爲接受的答案[在另一個問題](http://stackoverflow.com/q/4942984/1968)建議這個。 – 2011-02-09 11:05:06