Error Messages

This is a discussion on Error Messages within the C++ Programming forums, part of the General Programming Boards category; I'm getting syntax errors I can't find. If anyone can see them, please help. The coding is nowhere near done ...

  1. #1
    High school loser
    Join Date
    Dec 2004
    Posts
    27

    Error Messages

    I'm getting syntax errors I can't find. If anyone can see them, please help. The coding is nowhere near done but I'd rather debug as I went along so I know where the trouble is.
    Oh, and what's "call of overload sqrt(int) is ambiguous" mean?

    Code:
    #include <iostream>
    #include <stdlib.h>
    
    using namespace std;
    
    int DistanceFormula (int x1, int y1, int x2, int y2, int x3, int y3);
    int HeronsTheoremArea (int sideA, int sideB, int sideC);
    int Perimeter (int sideA, int sideB, int sideC);
    int TriangleCheck (int sideA, int sideB, int sideC);
    int ErrorTrap (int sideA, int sideB, int sideC);
    
    int main(int argc, char *argv[])
    {
      int sideA;
      int sideB;
      int sideC;
      int x1;
      int x2;
      int x3;
      int y1;
      int y2;
      int y3;
      
      ErrorTrap ( sideA,  sideB,  sideC)
          cout<< "Please enter coordinates of point A." <<endl;
          cin>> x1 >>y1;
          cout<<"Please enter coordinates of point B."<<endl;
          cin>> x2 >>y2;
          cout<<"Please enter coordinates of point C."<<endl;
          cin>> x3 >>y3;
          while (x1<-100||x1>100)
          {
              cout<<"Please enter between 100 and -100."<<endl;
              continue;
          }            
      DistanceFormula (x1, x2, x3, y1, y2, y3)
        
            sideA=sqrt(x2-x1)+(y2-y1);
            sideB=sqrt(x3-x2)+(y3-y2);
            sideC=sqrt(x1-x3)+(y1-y3);
        }    
    
      
      system("PAUSE");    
      return 0;
    }
    Last edited by applescruff; 01-24-2005 at 09:52 PM.
    "Confused by previous errors. Bailing out." --Bloodshed DevC++ compiler

  2. #2
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    functions have semicolons at the end:

    ErrorTrap ( sideA, sideB, sideC);
    DistanceFormula (x1, x2, x3, y1, y2, y3);

    and you have an extra } for some reason

    and what's up with this
    Code:
          while (x1<-100||x1>100)
          {
              cout<<"Please enter between 100 and -100."<<endl;
              continue;
          }
    umm.....that's just going to be an infinite loop....


    and don't use this
    system("PAUSE");

    EVER
    Last edited by jverkoey; 01-24-2005 at 09:53 PM.

  3. #3
    High school loser
    Join Date
    Dec 2004
    Posts
    27
    thanks
    "Confused by previous errors. Bailing out." --Bloodshed DevC++ compiler

  4. #4
    High school loser
    Join Date
    Dec 2004
    Posts
    27
    Quote Originally Posted by jverkoey
    and don't use this
    system("PAUSE");

    [color=red
    EVER[/color]
    Curiosity leads me to ask why not? I don't know what else should go there being a newbie with a bad teacher.
    "Confused by previous errors. Bailing out." --Bloodshed DevC++ compiler

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21