if we overloaded the operator ( ) and we have default constructor also than why both are running?
#include
using namespace std;
class fun{
public:
void operator()(string s){
cout<<“wow!”+s;
}
fun(string s)
{
cout<<“wow!”+s;
}
fun(){
cout<<“in default constructor”;}
};
int main()
{
fun f;
f(" What a time");
//fun f(" What a time “);
//f(” What a time ");
//fun f;
//fun f(‘hii’);
}