You get a bonus - 1 coin for daily activity. Now you have 1 coin

3.4. Overloading a function call operation

Lecture



3.4. Overloading a function call operation

This is a '()' operation. It is a binary operation. The first operand is usually a class object, the second is a parameter list.

Example.

class matriza // two-dimensional array of real numbers

{

...

public:

...

double operator () (int, int); // access to matrix elements by index

};

double matriza :: operator () (int i, int j)

{...}

void main ()

{class matriza a;

double k;

...

k: = a (5,6);

...

}

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "C ++ (C plus plus)"

Terms: C ++ (C plus plus)