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));
                    }       
    }

i got this errors : expression must have pointer-to-object type,subscript requires array or pointer type

2
  • @GMan Because the accepted answer in another question advises this. Commented Feb 9, 2011 at 11:05
  • @Konrad: Ah. :/ +1 to yours for sure. Commented Feb 9, 2011 at 11:10

1 Answer 1

1

It looks like the problem is that in your Test function you're passing in the data as an unsigned __int8 rather than as an array of these values. The subscripting with square brackets is what's causing the error. Changing the function to take it's value by array should fix this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.