Click here to Skip to main content
16,017,502 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Call of nonfunction means what in c++? Please tell.
Posted
Updated 14-Nov-22 13:03pm
v2

It means you are trying to call something that is not a function. For instance:

C++
int c;
c(); // this is a call to a nonfunction
 
Share this answer
 
Comments
Manfred Rudolf Bihy 3-Aug-11 11:35am    
My 5!
Sergey Alexandrovich Kryukov 3-Aug-11 14:26pm    
My 5. (I added some more explanation, please see my solution.)
--SA
To add a little explanation to the correct answer by Nemanja Trifunovic:

Mention in the compiler error message "call of nonfunction" does not mean a call of non-function really exists but somehow exists. There is no such thing. In C++, all you can call is always a function. The error message simple means "this is gibberish" but a compiler sees a call-like syntax (just because of "()" ) and suggests that a programmer really meant to make a call but have accidentally written a wrong identifier — of something non-callable.

For a record, you can also use the call-like syntax if you override a call operator "()" in your class, but this is a call of the function anyway. See, for example: http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fcplr327.htm[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900