摘要:
1 #include 2 using namespace std; 3 4 class MyClass1 5 { 6 public: 7 int a; 8 void Show(bool bSwitch) const //对应const 类 ,注意const的位置 9 {10 cout a = a;16 }17 private:18 int b; 19 };20 21 class MyClass2 : public MyClass122 {23 public:2... 阅读全文
摘要:
1 #include 2 using namespace std; 3 4 class MyClass1 5 { 6 public: 7 int a; 8 void Show(bool bSwitch) 9 {10 cout << "a=" << a << endl;11 }12 private:13 int b; 14 };15 16 class MyClass2 : public MyClass117 {18 public:19 int c;... 阅读全文
摘要:
1 #include 2 using namespace std; 3 class Test1 4 { 5 public: 6 int m; 7 Test1(int n) { num = n; } //普通构造函数 8 void Show() 9 {10 cout << "private num = " << num <<endl;11 }12 private:13 int count;14 int num;15 int n;16 };17 class Test218 {19 public:20 exp... 阅读全文
摘要:
1 #include 2 using namespace std; 3 4 class as 5 { 6 public: 7 int a; 8 const int b; 9 as():b(2)10 {11 a = 1;12 }13 ~as()14 {15 cout 2 using namespace std; 3 4 class A 5 { 6 public: 7 A() 8 { 9 cout << "A()" << endl;10 }11 ... 阅读全文
摘要:
1 private void BtnClickSaveCSV(object sender, EventArgs e) 2 { 3 checkBoxHideUseless.Checked = false; 4 int nColumns = nColumnsExist; 5 int nRows = dataGridView1.RowCount; //去掉最后的新行 6 string szToBeStored = "", szDelLogs = "", szMoveLogs = ""; 7 Stopwatch sw = new Stopwa 阅读全文
摘要:
1 #include 2 using namespace std; 3 4 struct Mys 5 { 6 int a; 7 void change(int a); 8 void show(int b); 9 };10 11 12 int main(int argc, char *argv[])13 {14 Mys mys_a;15 //给成员变量赋值 16 mys_a.a= 10;17 int d = 100;18 mys_a.change(d);19 //成员函数修改成员变量 20 mys_a.show... 阅读全文
摘要:
1 #include 2 using namespace std; 3 4 void show() 5 { 6 static int i = 0; 7 long t = time(NULL); 8 while(t == time(NULL)); 9 cout << "当前是第 " << i++ <<" 秒;" << endl;10 }11 12 int main(int argc, char *argv[])13 {14 for(;;)15 show();16 return 0;17 } 阅读全文
摘要:
1 //打开目录 2 private void BtnClickOpenDirPics(object sender, EventArgs e) 3 { 4 FolderBrowserDialog DirPics = new FolderBrowserDialog(); 5 DirPics.SelectedPath = "D:\\"; 6 7 if (DirPics.ShowDialog() == DialogResult.OK) 8 { 9 ... 阅读全文
摘要:
1 #include 2 using namespace std;3 int main(int argc, char *argv[])4 {5 cout << sizeof("goodbye") << endl;6 cout << strlen("goodbye") << endl;... 阅读全文
摘要:
1 #include 2 using namespace std; 3 4 void show(int a); 5 int main(int argc, char *argv[]) 6 { 7 void (* pfunc)(int a) = NULL; 8 pfunc = sh... 阅读全文