# WHAT is going ON!?

• 03-02-2006
Iceboy152
WHAT is going ON!?
Okay, i'm getting this really odd error message...26 times.

The message is:
Quote:

Error E2206 1: Illegal character ' ' (0x0)
My code to classify a triangle.
Code:

```#include <iostream> #include <cstdlib> #include <cmath> using namespace std; int main() {         int co1x;         int co1y;         int co2x;         int co2y;         int co3x;         int co3y;         int dis1;         int dis2;         int dis3;         cout<<"Enter the coordinates of the triangle" << endl;         cout<<"X coordinate of point 1: " << flush;         cin.ignore();         cin>>co1x;         cout<<"Y coordinate of point 1: "<< flush;         cin.ignore();         cin>>co1y;         cout<<"X coordinate of point 2: "<< flush;         cin.ignore();         cin>>co2x;         cout<<"Y coordinate of point 2: "<< flush;         cin.ignore();         cin>>co2y;         cout<<"X coordinate of point 3: "<< flush;         cin.ignore();         cin>>co3x;         cout<<"Y coordinate of point 3: "<< flush;         cin.ignore();         cin>> co3y;         sqrt((co1x - co2x)^2 + (co1y - co2y)^2) = dis1;         sqrt((co2x - co3x)^2 + (co2y - co3y)^2) = dis2;         sqrt((co3x - co1x)^2 + (co3y - co1y)^2) = dis3;         if (dis1 == dis2 && dis2 == dis3 && dis3 == dis1)         cout<<"The triangle is equilateral." << endl;                 else if (dis1 == dis2 && dis2 == dis1)         cout<<"The triangle is isoceles." << endl;                 else if (dis2 == dis3 && dis3 == dis2)         cout<<"The triangle is isoceles." << endl;         else if (dis3 == dis1 && dis1 == dis3)         cout<<"The triangle is isoceles." << endl;         else if (dis3 != dis1 && dis2 != dis1 && dis2 != dis3)         cout<<"The triangle is scalene." <<endl;                 cin.get(); }```
What is going on!?
• 03-02-2006
swgh
Post the whole code so I can see what is going on. It is no point posting just the header files and the error line if I cannot read what the program does
• 03-02-2006
Iceboy152
Done. I put it in the original post.
• 03-02-2006
Ideswa
0x0 is a hexadecimal character I think.

You're sure ^ is a legal C++ character?
• 03-02-2006
SlyMaelstrom
Code:

```        radical((co1x - co2x)^2 + (co1y - co2y)^2) = dis1         radical((co2x - co3x)^2 + (co2y - co3y)^2) = dis2         radical((co3x - co1x)^2 + (co3y - co1y)^2) = dis3```
Even if this made sense you're missing semicolons at the end of each of these lines. Now why are you trying to set a character with magic argument equal to an integer? If there is a function definition you aren't showing us, then post it.
• 03-02-2006
Iceboy152
Because he told me to.
Or at least I think that's what he meant.

Anyway, I added the semicolons, but it doesn't seem to help.
• 03-02-2006
Iceboy152
Sorry in advance for the double post.

Quote:

Originally Posted by Ideswa
0x0 is a hexadecimal character I think.

You're sure ^ is a legal C++ character?

No. But then again, I'm not sure it isn't, either. If you have a better way to raise a number to a power, please enlighten me.
• 03-02-2006
SlyMaelstrom
Ofcourse it doesn't those lines make no sense. You can't assign a character to an integer and expect the radical to be there. Besides, it looks like what you're trying to do is get the square root. You don't do that by adding a radical character to a number.

Add <cmath> and use the sqrt() function.
• 03-02-2006
Iceboy152
Okay, the error changed.

I'm also updating the code in the original post.

Here's the new error:
Quote:

Error E2277 39, 40 & 41: Lvalue required
Just for reference, here's those 3 lines:

Code:

```sqrt((co1x - co2x)^2 + (co1y - co2y)^2) = dis1;         sqrt((co2x - co3x)^2 + (co2y - co3y)^2) = dis2;         sqrt((co3x - co1x)^2 + (co3y - co1y)^2) = dis3;```
• 03-02-2006
SlyMaelstrom
Why don't use actually find out how to use sqrt() before you just throw it into your program.

Secondly. You're assigning the return TO A VARIABLE. Not a variable to the function return. disN should be on the left.
• 03-02-2006
Iceboy152
Ah...
• 03-02-2006
SlyMaelstrom
Download Dev-C++ and use it. It's magical and it makes money grow on trees.
• 03-02-2006
laserlight
Quote:

You're sure ^ is a legal C++ character?
It is, but it does bitwise XOR, not exponentiation.
• 03-02-2006
spydoor
Quote:

Originally Posted by Iceboy152
If you have a better way to raise a number to a power, please enlighten me.

in cmath
Code:

`double pow(double x, double y);`