non static member
I'm trying to validate an ip address by calling a method named generalOctecValidation(char* octet), bus as soon as I compile E get this error:
src/util/validate.cpp:9:2: error: call to non-static member function without an object argument
generalOctetValidation(octet);
^~~~~~~~~~~~~~~~~~~~~~
|
Here is the code:
1 2 3 4 5
|
bool Validate::generalOctetValidation(char *octet) {
int octetInt = std::stoi(octet);
if (octetInt <= 255 && octetInt >= 1) return true;
return false;
}
|
And the class validate:
1 2 3 4 5 6 7 8
|
class Validate {
public:
static bool generalIPValidation(std::string ipSource);
static bool routeableIPValidation(std::string ipSource);
private:
bool generalOctetValidation(char *octet);
};
|
Thanks!
Last edited on
I could fix the error already!
Topic archived. No new replies allowed.