2015年3月30日

摘要: //way 1union{ unsigned long biths; unsigned char bytes[4];} theValue;//way 2ndtypedef char* bytePointer;void showBytes(bytePointer p, int len){ in... 阅读全文
posted @ 2015-03-30 22:02 dotdog 阅读(232) 评论(0) 推荐(0) 编辑

2015年3月28日

摘要: /*v1*/void strcpy(char *s, char *t){ int i; i = 0; while((s[i] = t[i]) != '\0') i++;}/*v2*/void strcpy(char *s, char *t){ while((*s = *t) != ... 阅读全文
posted @ 2015-03-28 13:07 dotdog 阅读(192) 评论(0) 推荐(0) 编辑

2015年3月27日

摘要: /*返回t在s中的位置,若未找到则返回-1*/int strindex(char* s,char* t){ int i, j, k; for(i = 0; s[i] != '\0'; i++) for(k = i,j = 0; s[k]=t[j] && s[k]!='\0'; k++,... 阅读全文
posted @ 2015-03-27 22:21 dotdog 阅读(135) 评论(0) 推荐(0) 编辑
摘要: class apple {public: ~apple(){ std::cout << "~apple()" << std::endl;}};class banana : public apple { ~banana(){ std::cout << "~banana()" << std::e... 阅读全文
posted @ 2015-03-27 21:43 dotdog 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 1 class base { 2 public: 3 virtual void test1() { std::cout << "base::test1"<< std::endl; } 4 void test2(){ std::cout << "base::test2"; } ... 阅读全文
posted @ 2015-03-27 21:26 dotdog 阅读(117) 评论(0) 推荐(0) 编辑

导航