Home > Back-end >  Where is the problem of code?
Where is the problem of code?

Time:04-21

//the header file
# pragma once
#include
The class SD_Point
{
Float x, y;
Public:
Void Set_Point (float, float);
Float Get_X ();
Float Get_Y ();
Void Get_Point ();
SD_Point ();
SD_Point (float, float);
Float operator * (SD_Point);
Friend ostream& Operator<(ostream& , SD_Point & amp;);
};

//implementation file
# include "SD_Point. H"
#include
#include
using namespace std;

SD_Point: : SD_Point ()
{
X=y=0;
}

SD_Point: : SD_Point (float x, float y)
{
This - & gt; X=x;
This - & gt; Y=y;
}

Void SD_Point: : Set_Point (float x, float y)
{
This - & gt; X=x;
This - & gt; Y=y;
}

Float SD_Point: : Get_X ()
{
Return the x;
}

Float SD_Point: : Get_Y ()
{
The return of y;
}

Void SD_Point: : Get_Point ()
{
cout <"(" & lt; }

Float SD_Point: : operator * (SD_Point point)
{
Float d;
(d=(float) SQRT (pow this - & gt; X - point x, (2) + pow this - & gt; Y - point. Y, 2));
Return d;
}

Ostream & amp; The operator & lt; <(ostream& Out, SD_Point & amp; Point)
{
The out & lt; <"(" & lt; Return the out;
}

//contains the main function of file
# include "SD_Point. H"
#include
using namespace std;

Int main ()
{
SD_Point point (1, 3);
cout }

CodePudding user response:


This is an error message,

CodePudding user response:

Under the building Lord are grammatical errors, tried the above code, compile run found no problems, Suggestions on debugging to modify a file, succeeded to file,
 
(1, 3)
Please press any key to continue...
  • Related