hello everone

i'm new to c++ language

Is This possible to make prg in cpp to overload () Opratore

if yes, then can u pls give any logical flow for develope the prg

i.e. which kind of opeartion can be performed through () opratore

thanx in advance

Are you thinking about using the () as the conversion operator or talking about overloading the () operator to do something like addition or concatenation or some other theoretical possibility?


i have some idea that in overloading of + operatore we can

perform summation or can concate to string

so whould u pls tell me which kind of

operation should i perform for overload the

() as operatore

When you overload the () operator, it's used as if it were a function call operator and nothing more:

#include <iostream>

struct foo {
    void operator()()

int main()
    foo bar;


If that's not what you want, you're SOL.

yes i aggre whith u but

whould u pls suggest me which kind of operation

is suitable for overloading () as operatore

It sounds disturbingly like you're looking for a problem to fit the solution you recently learned. That's silly.

This question has already been answered. Start a new discussion instead.