473,382 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Keep reciving error C2064, why?

blackstormdragon
I keep getting this error when building my code. error C2064: term does not evaluate to a function taking 1 arguments.

Expand|Select|Wrap|Line Numbers
  1. #include<iostream>
  2. #include<cmath>
  3. using namespace std;
  4. double areaFunction(double,int,int,int);
  5. int perimeterFun(int,int,int);
  6.  
  7. void main()
  8. {
  9.     int side, side2, side3, perimeter;
  10.     double semi, area;
  11.     cout<<"Enter the side of a triangle ";
  12.     cin>> side;
  13.     cout<<"Enter the side of a triangle ";
  14.     cin>> side2;
  15.     cout<<"Enter the side of a triangle ";
  16.     cin>> side3;
  17.  
  18.     if(side + side2 > side3 && side2 + side3 > side && side + side3 > side2)
  19.     {
  20.         semi =(side + side2 + side3)/ 2.0;
  21.         area = areaFunction(semi,side,side2,side3);
  22.         perimeter = perimeterFun(side,side2,side3);
  23.  
  24.         cout<<"The area of the triangle is "<<area<<endl;
  25.         cout<<"The perimeter of the triangle is "<<perimeter<<endl;
  26.  
  27.     }
  28.     else
  29.         //Triangle is illegal
  30.         cout<<"These side values produce an illegal triangle."<<endl<<endl;
  31.  
  32. }
  33. double areaFunction(double semi,int side,int side2,int side3)
  34. {
  35.     return sqrt(semi(semi-side)(semi-side2)(semi-side3));    
  36. }
  37. int perimeterFun(int side,int side2,int side3)
  38. {
  39.     return side + side2 + side3;
  40. }
  41.  
For the life of me I can't see what's wrong.
Feb 28 '07 #1
3 5238
horace1
1,510 Expert 1GB
have you missed the * operators in the sqrt() expression?, e.g.
Expand|Select|Wrap|Line Numbers
  1. double areaFunction(double semi,int side,int side2,int side3)
  2. {
  3.     return sqrt(semi*(semi-side)*(semi-side2)*(semi-side3));    
  4. }
  5.  
Feb 28 '07 #2
have you missed the * operators in the sqrt() expression?, e.g.
Expand|Select|Wrap|Line Numbers
  1. double areaFunction(double semi,int side,int side2,int side3)
  2. {
  3.     return sqrt(semi*(semi-side)*(semi-side2)*(semi-side3));    
  4. }
  5.  
Yes, I now feel very stupid. Thanks you for seeing that.
Feb 28 '07 #3
RedSon
5,000 Expert 4TB
Thats "eagle eye" horace for ya!
Feb 28 '07 #4

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

Similar topics

1
by: Skavenger | last post by:
Hi, I'm attempting to use a class member function pointer to call a relevant function. This is done like this.... typedef void(SampleA::*SAMPLEAFUNC)(void); class SampleA { public:...
7
by: Abhi | last post by:
Hi all, I am using .net for C++ and I would like to write some variable values to some files. I will be using that file in many member functions of the class. So I declared the file variable...
0
by: Adi Doron | last post by:
Dear Sir,Madam: How can i open multicast channel for: a) Sending Only b) Reciving Only Best Regards to all =================== Adi
3
by: nkoriginal | last post by:
Hello: I tried an script for keep my data form after reload page, but I've some errors. In this momento I runnung my own browser because we've an intranet. And for security reason, our page...
1
by: patilanjana | last post by:
Hi, I am getting above mentioned errors. Checked msdn, read the comments but I fail to implement it. Please help. Error is regarding using the new and delete operators. Although I do write...
0
by: Ola | last post by:
I have an application that is runing all the time, 24 7. Sometimes it just stops and I recive this error: " has encounted a problem and needs to close. We are sorry for the inconvenience" And...
1
by: dannyk | last post by:
hi, I need a solution for displaying and reciving a video stream in a c# application. how can I do it? what should i do?
1
by: George2 | last post by:
Hello everyone, Here is the code, and if I change line from static wchar_t* p = {PREFIX((wchar_t*)_TEXT("FOO"))}; to static wchar_t* p = {PREFIX(_TEXT("FOO"))};
0
by: abhishekForgotten | last post by:
Looking for some guidance on whether SMPP v3.4 will support greek messages or not ? If not how i can recive/send greek message via smpp v3.4, without decreasing length of msg (160) , I know if i...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.