摘要:
1 char *strcpy(char *strDest, const char *strSrc) 2 { 3 assert((strDest != NULL) && (strSrc != NULL)); 4 char *address = strDest; 5 while... 阅读全文
posted @ 2015-03-24 15:08
David_W
阅读(177)
评论(0)
推荐(0)
摘要:
1. 常量必须在构造函数的初始化列表里面初始化。class A { const int size = 0; }; 是错误的。 需要改成 class A{ A(){ const int size = 10; } };或者改成 class A { static const int size = 10; ... 阅读全文
posted @ 2015-03-24 15:02
David_W
阅读(449)
评论(0)
推荐(0)
摘要:
1 #include 2 3 // compare function 4 int jug(int x, int y) 5 { 6 if(x >= 0) return x; 7 else if(y == 0) return x; 8 else return x/y; ... 阅读全文
posted @ 2015-03-24 10:06
David_W
阅读(139)
评论(0)
推荐(0)