2013年5月7日
摘要: 1 #include 2 #include 5 void myStrcpy(char* Dest, const char *Src) 6 { 7 assert((Dest!= NULL)&&(Src!=NULL)); 8 while((*Dest = *Src)!='\0') 9 {10 Dest++;11 Src++;12 }13 }14 15 int main()16 {17 char dest[] = "helloworld";//注意18 char* src = "hello";19 mySt... 阅读全文
posted @ 2013-05-07 16:15 猿人谷 阅读(438) 评论(0) 推荐(0)
摘要: 首先看一个例子: 1 #include <iostream> 2 using namespace std; 3 4 class A{}; 5 6 class B 7 { 8 int b; 9 char c;10 };11 12 class C13 {14 int c1; 15 static int c2;16 };17 int C::c2 = 1;18 19 class D:public C,public B{20 int d;21 }; 22 int main()23 {24 cout<<"sizeof(A)="<<sizeof(A). 阅读全文
posted @ 2013-05-07 16:07 猿人谷 阅读(467) 评论(0) 推荐(0)