I keep getting this error when building my code. error C2064: term does not evaluate to a function taking 1 arguments. -
#include<iostream>
-
#include<cmath>
-
using namespace std;
-
double areaFunction(double,int,int,int);
-
int perimeterFun(int,int,int);
-
-
void main()
-
{
-
int side, side2, side3, perimeter;
-
double semi, area;
-
cout<<"Enter the side of a triangle ";
-
cin>> side;
-
cout<<"Enter the side of a triangle ";
-
cin>> side2;
-
cout<<"Enter the side of a triangle ";
-
cin>> side3;
-
-
if(side + side2 > side3 && side2 + side3 > side && side + side3 > side2)
-
{
-
semi =(side + side2 + side3)/ 2.0;
-
area = areaFunction(semi,side,side2,side3);
-
perimeter = perimeterFun(side,side2,side3);
-
-
cout<<"The area of the triangle is "<<area<<endl;
-
cout<<"The perimeter of the triangle is "<<perimeter<<endl;
-
-
}
-
else
-
//Triangle is illegal
-
cout<<"These side values produce an illegal triangle."<<endl<<endl;
-
-
}
-
double areaFunction(double semi,int side,int side2,int side3)
-
{
-
return sqrt(semi(semi-side)(semi-side2)(semi-side3));
-
}
-
int perimeterFun(int side,int side2,int side3)
-
{
-
return side + side2 + side3;
-
}
-
For the life of me I can't see what's wrong.
3 5238
have you missed the * operators in the sqrt() expression?, e.g. -
double areaFunction(double semi,int side,int side2,int side3)
-
{
-
return sqrt(semi*(semi-side)*(semi-side2)*(semi-side3));
-
}
-
have you missed the * operators in the sqrt() expression?, e.g. -
double areaFunction(double semi,int side,int side2,int side3)
-
{
-
return sqrt(semi*(semi-side)*(semi-side2)*(semi-side3));
-
}
-
Yes, I now feel very stupid. Thanks you for seeing that.
Thats "eagle eye" horace for ya!
Sign in to post your reply or Sign up for a free account.
Similar topics
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:...
|
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...
|
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
|
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...
|
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...
|
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...
|
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?
|
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"))};
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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$) {
}
...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| | |