Reputation: 133
I am using Visual Studio. When I try to compile my code, I get an error saying 21 "IntelliSense: identifier "[blank]" is undefined" for each of the variables used in the "hexISOS" function. I have defined these variables later on in the code and was wondering if anybody could tell me what is wrong.
My code looks like this:
#include <iostream>
#include <cmath>
using namespace std;
int hexISOS(double AX, AY, BX, BY, CX, CY, DX, DY)
{
long double sol1, sol2;
bool ans;
sol1 = sqrt(pow((AX - CX), 2) + pow((AY - CY), 2));
sol2 = sqrt(pow((BX - DX), 2) + pow((BY - DY), 2));
if(sol1 == sol2)
{
ans = true;
}
else
{
ans = false;
}
cout << "\nThe distance between A and C is " << sol1 << endl;
cout << "The distance between B and D is " << sol1 << endl;
cout << "\nIsosceles = " << ans;
return 0;
}
int main()
{
double AX, AY, BX, BY, CX, CY, DX, DY;
cout << "AX: ";
cin >> AX;
cout << "\nAY: ";
cin >> AY;
cout << "\nBX: ";
cin >> BX;
cout << "\nBY: ";
cin >> BY;
cout << "\nCX: ";
cin >> CX;
cout << "\nCY: ";
cin >> CY;
cout << "\nDX: ";
cin >> DX;
cout << "\nDY: ";
cin >> DY;
hexISOS(AX, AY, BX, BY, CX, CY, DX, DY);
return 0;
}
Upvotes: 2
Views: 3101
Reputation: 4750
That thing where you can use a data type once and then a bunch of variable names - as in the first line of your main function - I don't think you can do that in the parameter list of a function. Try doing this and see if that helps:
int hexISOS(double AX, double AY, double BX, double BY, double CX, double CY, double DX,
double DY)
Edit: Another thing I don't think is legal is this:
long double sol1, sol2;
You'll probably need to change it to either something like this:
long sol1;
double sol2;
or something like this:
double sol1, sol2;
Upvotes: 1