NOW.. if i change in the main() function circle z; to
circle z();
then the following error occurs:
Compiling...
circle_thispointer2.cpp

error C2659: '=' : overloaded function as left operand

error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class circle (__cdecl *)(void)' (or there is no acceptable conversion)
P.S: THIS IS NOT A HOME WORK..lol
Error executing cl.exe.

Can someone pls explain why it occurs?:mad: and its mechanism:thumbsup:

oesxyl

07-04-2009, 07:22 AM

NOW.. if i change in the main() function circle z; to
circle z();
then the following error occurs:
Compiling...
circle_thispointer2.cpp

Can someone pls explain why it occurs?:mad: and its mechanism:thumbsup:
z() is function, z is variable. is a syntax problem.

best regards

adarshakb

07-04-2009, 07:25 AM

a variable and function diference.... and i didnt know that.. thks..
another question :confused:

Then why does the compiler give error about the overloaded operator??

oesxyl

07-04-2009, 07:29 AM

a variable and function diference.... and i didnt know that.. thks..
another question :confused:

Then why does the compiler give error about the overloaded operator??
compiler try to guess what was wrong and jump to conclusion that you intend to overload the () operator but it fail to find the declaration, :)

best regards

adarshakb

07-04-2009, 07:33 AM

compiler try to guess what was wrong and jump to conclusion that you intend to overload the () operator but it fail to find the declaration, :)

best regards

:D:thumbsup:

oesxyl

07-04-2009, 07:45 AM

:D:thumbsup:
:)

is oftopic but I would prefere to implement circle constructor like this: