C ++ object

Source: Internet
Author: User

/** <Br/> * @ file virtualbash. CPP <br/> * @ brief <br/> * @ author liugang <br/> * @ version 1.0 <br/> * @ date 2009-12-09 <br/> */<br /># include <iostream> <br/> using namespace STD; <br/> class point2d {<br/> Public: <br/> point2d (): _ x (0), _ y (0 ){}; <br/> protected: <br/> float _ x; <br/> float _ y; <br/>}; <br/> class vertex: public Virtual point2d {<br/> Public: <br/> vertex (): Next (0) {}; <br/> protected: <br/> vertex * next; <br/>}; <br/> class point3d: Public Virtual point2d {<br/> Public: <br/> point3d (): _ z (0 ){}; <br/> protected: <br/> float _ z; <br/>}; <br/> class vertex3d: Public vertex, public point3d <br/>{< br/> Public: <br/> vertex3d (): mumble (0) {}; <br/> protected: <br/> float mumble; <br/>}; <br/> int main (INT argc, char * argv []) <br/>{< br/> point2d P2D; <br/> vertex VX; <br/> point3d p3d; <br/> vertex3d v3d; <br/> point2d * p2d1 = & P2D; <br/> point2d * p2d2 = & VX; <br/> point2d * p2d3 = & p3d; <br/> point2d * p2d4 = & v3d; <br/> return 0; <br/>}< br/>/* VIM: Set Ts = 8 SW = 8: */<br/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.