how do i point to a method?
So i think its pretty clear from the code what I'm trying to do here. Thanks in advance to anyone who takes a look!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <iostream>
bool *pbTrue;
class Class1
{
public:
void updatePointer() {
pbTrue=&bTrue;
}
bool bTrue() {
return true;
}
} qClass1;
int main() {
qClass1.updatePointer();
if (*pbTrue) {
std::cout << "i want this to print" << std::endl;
}
std::cin.ignore();
}
|
nvm, problem solved with polymorphism
Topic archived. No new replies allowed.