Home > Back-end >  C class member function
C class member function

Time:09-30

In c + + member functions to be defined outside the class, in class definitions circle, about how to deal with circle in the center position? I am a beginner, trouble which the great spirit

CodePudding user response:

Don't quite understand your paper
It is commonly defined in such a structure
Struct Point ()
{
Int x;
Int y;
} Point
Public Point Opoint;
Each class instantiation of the round object circle
Has circle (circle) point) x, circle, point. Y)
If the trouble, direct
The class circle {
Int x, y, r;
Public circle (int a, b int, int) c
{
X=a;
Y=b;
C=r;
}
Then
Circle c=new circle (y center coordinates x, the center of the circle, circle radius);
  • Related