472,354 Members | 1,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

error: call of a non function

I'm suppode to write a prg to calculate maximum and minimum of 4 intergers by using functions
i've writen the code but getting the error: call of a non function..cant see my error help me..here is my code

void max(int a,int b,int c,int d);
void min(int a,int b,int c,int d);
int num1,num2,num3,num4,max_val,min_val;
void main()
int num1,num2,num3,num4,max,min;
cout<<"Input 4 integer values"<<endl;




void max(int a,int b,int c,int d)
{ max_val=a;
if (b>max_val)
if (c>max_val)
if (d>max_val)
cout<<"The maximum integer value is:"<<max_val<<endl;

void min(int a,int b,int c,int d)
{ min_val=a;
if (b<min_val)
if (c<min_val)
if (d<min_val)
cout<<"The minimum integer value is:"<<min_val<<endl;

Same error when am dong another program for calculating the average of 4 integers..
here is my code

float avg(int a,int b,int c,int d);
void main()
int w,x,y,z;
float avg;
cout<<"Input four numbers"<<endl;
cout<<"The average of the four numbers is:"<<avg(w,x,y,z)<<endl;
float avg(int a,int b,int c,int d)
{float p;
return p;

plz help me find my error
thx alot
Nov 19 '06 #1
1 6625
1,510 Expert 1GB
in main() you define two local variables max and min which 'hide" the functions max() and min(), when you attempt to call the functions
Expand|Select|Wrap|Line Numbers
  1. max(num1,num2,num3,num4);
  2. min(num1,num2,num3,num4);
the compiler thinks you are calling the local variables as though they are functions

remove the max and min local variables and the program works.
Nov 19 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Xeon | last post by:
Hi, Is there anyway to set a custom error handler which is actually a method of a class? i.e. setting the method eh() of class foo as error handler in the snippet below. class foo { function...
by: Bob Bamberg | last post by:
Hello All, I have been trying without luck to get some information on debugging the Runtime Error R6025 - Pure Virtual Function Call. I am working in C++ and have only one class that is derived...
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
by: Kurt Van Campenhout | last post by:
Hi, I am trying to get/set Terminal server information in the active directory on a windows 2000 domain. Since the ADSI calls for TS don't work until W2K3, I need to do it myself. I'm fairly...
by: Ken | last post by:
When running a program in the debugger, what would cause it to crash without any error messages? I get "The program has exited with code 0 (0x0)". The program is a MDI app with threading for...
by: mario.zoric | last post by:
Hi to all! I have one big problem. I have written some code and I want to program at the end looks good but theres one uninspected error. What's going on? I have written code for programm that...
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As...
by: spmanoj78 | last post by:
Hi, I am trying to install DB2 v8.2 on RHEL 5 in silient mode. Can anybody help me out. The Same DB2 v8.2 works fine on SUSE 10. ##################################################### ...
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.