Results 1 to 3 of 3

Thread: C++

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User vanmx's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,964

    C++

    ,

    , . , X Y, , .
    :

    Code:
    #include <iostream>
    //#include <cmath>
    
    using namespace std;
    
    class point
    {
          private:
                  double x,y;
          public:
          point();
          point (double a, double b);
          ~point();
          void setx(double a) {x=a;};
          void sety(double b) {y=b;};
          double getx(){return x;};
          double gety(){return y;};
    };
    class square:public point
    {
         private:
                 double length;
    
         public:
               
    
                 square(double c, double x, double y);
                 ~square();
                 double get_SquareSide() {return length;};
    };
    
    point::point(double a,double b)
    {
                        x=a;
                        y=b;
    };
    
    point::point()
    { x=y=0;};
    square::square(double c,double x,double y)
    {
                          length=c;
                          setx(x);
                          sety(y);
    };
    int main() point A square B, (DevC++) " [Linker error] undefined reference to `point::~point()' "
    , ...
    X470 AORUS ULTRA GAMING | Ryzen5 2600 |2x16GB Corsair LPX 3200Mhz | EVGA GeForce GTX 1080 Ti SC Black Edition Gaming|512GB Samsung 970 Pro +
    512GB ADATA SU800| Corsair HX1200i | Corsair Graphite 600t |BENQ PD3200U

  2. #2
    Jedem das Seine Glimmer's Avatar
    Join Date: Jun:2004
    Location:
    Posts: 1,136
    ~point() {} point::~point() {} -. , .
    DX58SO | x5670@4.2 | Megahalems | 3x4 EBJ40EG8BFWB-JS-F@1400 MHz | MSI GTX 970 1488/8000 | THNSNH256GBST + 3 x WD1600HLHX RAID 0 | X-Fi Titanium | P1-1250-BEFX
    The big trouble with dumb bastards is that they are too dumb to believe there is such a thing as being smart. Kurt Vonnegut

  3. #3
    Registered User vanmx's Avatar
    Join Date: Oct:2006
    Location:
    Posts: 1,964
    ,
    X470 AORUS ULTRA GAMING | Ryzen5 2600 |2x16GB Corsair LPX 3200Mhz | EVGA GeForce GTX 1080 Ti SC Black Edition Gaming|512GB Samsung 970 Pro +
    512GB ADATA SU800| Corsair HX1200i | Corsair Graphite 600t |BENQ PD3200U

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |