美文网首页
Boolan_C++面向对象高级编程(上)-第2周

Boolan_C++面向对象高级编程(上)-第2周

作者: ClickHouse | 来源:发表于2017-02-07 21:38 被阅读5次

内存块

Complex

class complex {
public:
    complex (double r = 0, double i = 0): re (r), im (i) { }
    complex& operator += (const complex&);
    complex& operator -= (const complex&);
    complex& operator *= (const complex&);
    complex& operator /= (const complex&);
    double real () const { return re; }
    double imag () const { return im; }
private:
    double re, im;
    friend complex& __doapl (complex *, const complex&);
    friend complex& __doami (complex *, const complex&);
    friend complex& __doaml (complex *, const complex&);
};

动态分配所得内存 in VC

1.png

动态分配所得的array

2.png

array new 为什么要搭配array delete

3.png

相关文章

网友评论

      本文标题:Boolan_C++面向对象高级编程(上)-第2周

      本文链接:https://www.haomeiwen.com/subject/pbimittx.html