随笔分类 - c++
摘要:priority_queueType: Type of the elements.Container: Type of the underlying container object used to store and access the elementsCompare: Comparison class: A class such that the expression comp(a,b), where comp is an object of this class and a and b are elements of the container, returns true if a i
阅读全文
摘要:virtual修饰的函数可以在派生的类中重新定义,可以通过动态分配对象的基类指针实现多借口。例:#includeusing namespace std;class A{ public: A(int x=0):t(x){} virtual int f() { return t; } private: int t;};class B:public A{ public: B(int x=0,int y=0):A(x),t(y){} int f() {...
阅读全文

浙公网安备 33010602011771号