How do I know what will be executed, operator() or static function. Although I thought that static can only stay in class, what is this static modifier doing?
#include <iostream>
using namespace std;
class A {
private:
int i;
public:
A(int ii) { i = ii; }
int dohvati() { return i; }
int operator()() { return 3; }
};
static int a() { return 4; }
int main() {
A a(2);
cout << a();
return 0;
}