摘要:
#include <iostream> #include <string> using namespace std; class Base { public: int k; Base(int n):k(n) { } }; class Big { public: int v; Base b; Big( 阅读全文
摘要:
#include <iostream> using namespace std; class A { public: int i; A(int x) { i = x; } ~A() { cout << i << endl; } }; int main() { A a(1); A * pa = new 阅读全文
摘要:
#include <iostream> using namespace std; class A { public: int val; A(int n):val(n) { } A():val(123){} A & GetObj() { return *this; } }; int main() { 阅读全文
摘要:
#include <iostream> #include <cstring> #include <cstdlib> using namespace std; class Complex { private: double r,i; public: void Print() { cout << r < 阅读全文
摘要:
#include <iostream> using namespace std; class A { public: int val; A(int n):val(n) {} A():val(123){} A & GetObj() { return *this; } }; int main() { i 阅读全文
摘要:
#include <iostream> using namespace std; class Sample { public: int v; Sample(){} Sample(int a):v(a){} Sample(const Sample& s) { v = s.v+2; } }; void 阅读全文
摘要:
#include <iostream> #include <string> #include <cstdio> #include <cstring> #include <sstream> #include <cstdlib> using namespace std; class Student { 阅读全文
摘要:
#include <iostream> #include <string> #include <cstdio> #include <cstring> #include <sstream> #include <cstdlib> using namespace std; class Student { 阅读全文
摘要:
#include <iostream> using namespace std; int main() { int * a[] = { NULL,NULL, new int(123),new int[6] {1,1,1,1,1,456} }; *a[2] = 123; a[3][5] = 456; 阅读全文
摘要:
#include <iostream> using namespace std; int & getElement(int * a, int i) { return a[i]; } int main() { int a[] = {1,2,3}; getElement(a,1) = 10; cout 阅读全文