• 大小: 161KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-05
  • 语言: C/C++
  • 标签: 浙江大学  c++  翁凯  

资源简介

浙江大学计算机系翁凯老师面向对象编程语言(oop)课件,采用英文原版教材《thinking in c++》,课件+源代码

资源截图

代码片段和文件信息

//: C12:AutomaticOperatorEquals.cpp
// From Thinking in C++ 2nd Edition
// Available at http://www.BruceEckel.com
// (c) Bruce Eckel 2000
// Copyright notice in Copyright.txt
#include 
using namespace std;

class Cargo {
public:
  Cargo& operator=(const Cargo&) {
    cout << “inside Cargo::operator=()“ << endl;
    return *this;
  }
};

class Truck {
  Cargo b;
};

int main() {
  Truck a b;
  a = b; // Prints: “inside Cargo::operator=()“
} ///:~

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2009-04-05 21:10  8 Operator Overload\
     文件        6148  2008-05-07 13:02  8 Operator Overload\.DS_Store
     目录           0  2009-04-05 21:10  __MACOSX\
     目录           0  2009-04-05 21:10  __MACOSX\8 Operator Overload\
     文件          82  2008-05-07 13:02  __MACOSX\8 Operator Overload\._.DS_Store
     文件      180127  2009-04-05 21:10  8 Operator Overload\8 Overloaded Operators.pdf
     文件          82  2009-04-05 21:10  __MACOSX\8 Operator Overload\._8 Overloaded Operators.pdf
     目录           0  2008-05-07 13:02  8 Operator Overload\ex\
     文件         486  2001-09-27 04:43  8 Operator Overload\ex\AutomaticOperatorEquals.cpp
     文件         393  2001-09-27 04:43  8 Operator Overload\ex\AutomaticTypeConversion.cpp
     文件         385  2006-10-12 00:42  8 Operator Overload\ex\CopyingVsInitialization.cpp
     文件         419  2001-09-27 04:43  8 Operator Overload\ex\CopyingVsInitialization2.cpp
     文件        1132  2001-09-27 04:43  8 Operator Overload\ex\DefaultCopyConstructor.cpp
     文件         452  2001-09-27 04:43  8 Operator Overload\ex\ExplicitKeyword.cpp
     文件         840  2006-10-02 10:49  8 Operator Overload\ex\HowMany.cpp
     文件         912  2006-10-03 02:04  8 Operator Overload\ex\HowMany2.cpp
     文件         493  2001-09-27 04:43  8 Operator Overload\ex\NoCopyConstruction.cpp
     文件         745  2001-09-27 04:43  8 Operator Overload\ex\OperatorOverloadingSyntax.cpp
     文件         254  2006-10-02 08:28  8 Operator Overload\ex\Person.cpp
     文件         270  2006-10-02 08:28  8 Operator Overload\ex\Person.h
     文件         217  2007-05-14 11:22  8 Operator Overload\ex\plus.cpp
     文件         844  2006-10-11 09:57  8 Operator Overload\ex\SimpleAssignment.cpp
     文件        1458  2001-09-27 04:43  8 Operator Overload\ex\SmartPointer.cpp
     文件         223  2006-10-05 02:15  8 Operator Overload\ex\StatFun.cpp
     文件         284  2006-10-05 02:14  8 Operator Overload\ex\StatFun.h
     文件         449  2006-10-05 02:07  8 Operator Overload\ex\StatMem.cpp
     文件         261  2006-10-04 10:04  8 Operator Overload\ex\StatMem.h
     文件         478  2001-09-27 04:43  8 Operator Overload\ex\TypeConversionAmbiguity.cpp
     文件         169  2006-10-06 08:04  8 Operator Overload\ex\Vector.cpp
     文件         283  2006-10-06 08:03  8 Operator Overload\ex\Vector.h

评论

共有 条评论