Date

cout << "Current date is:\n" << MyDate.getCmonth << "/" << MyDate.getCDay << "/" << MyDate.getCyear;

when I am using this string to recall a date from a header file i get the following error

"Error: A pointer to a bound function may only be used to call the function"

Any help and a brief explanation would be appreciated.
You forgot the parenthesis to show the compiler that you want to call a function:
cout << "Current date is:\n" << MyDate.getCmonth() << "/" << MyDate.getCDay() << "/" << MyDate.getCyear();
when i added that it says "too few arguments in function call"
The compiler says exactly what is the problem: "too few arguments in function call". Meaning that you have to provide some parameters to the function.

For example:
1
2
3
4
5
6
7
8
9
10
11
class C {
public:
   int multiplyBy2(int x) { return x * 2; }
};

void main()
{
    C c;
    cout << c.multiplyBy2();  // "too few arguments in function call" - function doesn't know what should be multiplied by 2 
    cout << c.multiplyBy2(1); // ok
}


Same is valid for the member functions of the MyDate object. Take a look at which parameters are required and pass them to the function call.
Topic archived. No new replies allowed.