How to call a method within the class?

1

I'm trying to call the method that returns a unsigned char through another method of the same class, I've reviewed the entire internet but I did not understand how to do it.

byte CryrazCore::*ComputeByteArray(byte inputData[], bool decryptMode)
{
    int cs = this->CryrazCore::PushChecksum();
}

The method I'm trying to call is called CryrazCore::PushChecksum() , here's the declaration of it:

// CryrazCore.cpp
byte CryrazCore::PushChecksum()
// CryrazCore.h
byte PushChecksum();

Here's what it says in the error, in the first line of the question.

  

'this': can only be referenced inside non-static member functions or non-static data member initializers

Where am I wrong to call the function?

    
asked by anonymous 29.07.2017 / 06:43

1 answer

1

This code does not compile for other reasons either. Probably it would look like this:

byte *CryrazCore::ComputeByteArray(byte inputData[], bool decryptMode) {
    int cs = this->PushChecksum();
    //deveria usar os parâmetros
    return alguma coisa que seja um ponteiro para byte;
}

I placed GitHub for future reference .

You have to decide whether to use this-> or CryrazCore:: , both do not. The first one calls the instance, which seems to be the case, the second one calls a static member.

Try to make simpler examples before you start doing the more complex ones.

    
29.07.2017 / 08:28