error int assumed. Note: C++ does not support default-int

Can you help me to remove this error?
objects (1).cpp(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "stdafx.h"
using namespace std;

class myClass
{
    public:
       int operator() (int p);
};

myClass::operator()(int p)
{
    cout << "Operator () is called with parameter " << p << endl;
    return p * 2;
}

int main()
{
}


I have no idea what's the problem. I have copied code from one article, and also read article about operators overload but I cannot find where is problem.
You forgot to put an int on line 10

int myClass::operator()(int p)
ty
Topic archived. No new replies allowed.