C for Engineers and Scientists Third Edition文档.pptVIP

  • 6
  • 0
  • 约1.74万字
  • 约 58页
  • 2018-02-27 发布于湖北
  • 举报

C for Engineers and Scientists Third Edition文档.ppt

C for Engineers and Scientists Third Edition文档

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Chapter Summary Assignment operator can be declared for class as: void operator=(className); Copy constructor initializes one object by using another object of the same class className(const className); Each class has associated class scope defined by brace pair {} containing class definition Each class object has separate memory for members except those declared static Static function members apply to class as whole rather than to separate objects C++ for Engineers and Scientists, Third Edition * Chapter Summary (continued) Non-member function can access class’s private data members if granted friend status User-defined operators can be constructed for classes by using operator functions User-defined operators can be called as a conventional function with arguments or as an operator function Operator functions can also be written as friend functions C++ for Engineers and Scientists, Third Edition * Chapter Summary (continued) Four categories of data type conversions Built-in types to built-in types Built-in types to class types Class types to built-in types Class types to class types Type conversion constructor: First argument is not a member of its class; any remaining arguments have default values Conversion operator function: Member function having the name of a class No explicit arguments or return type C++ for Engineers and Scientists, Third Edition * Chapter Summary (continued) Inheritance: Capability of deriving one class from another class Initial class used as basis for derived class: base, parent, or superclass Derived class: child or subclass Base class functions can be overridden by derived class functions with same name Polymorphism: Capability of having the same function name invoke different responses based on the object making the call C++ for Engineers and Scientists, Third Edition * Chapter Summary (continued) Override functions and virtual functions can be used to implement polymo

文档评论(0)

1亿VIP精品文档

相关文档