上一页 1 2 3 4 5 6 7 ··· 14 下一页
摘要: #include void InsertSort(int a[],int len) { int temp=0,i,j; for(i=1;i=0&&temp #include using namespace std; DWORD WINAPI Fun1Proc(LPVOID lpParameter); DWORD WINAPI Fun2Proc(LPVOID lpParame... 阅读全文
posted @ 2014-09-01 10:48 yexuannan 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 1、任意位的整数转化为字符串 #include #include using namespace std; char * NumberToString(int n) { int nn=n,i=0; while(nn!=0) { nn=nn/10; i++; } char *temp=new char[i+1];//可实... 阅读全文
posted @ 2014-08-28 10:15 yexuannan 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1、explicit explicit 只对构造函数起作用,用来抑制隐式转换。 如: class A { A(int a); }; int Function(A a); 当调用 Function(2) 的时候,2 会隐式转换为 A 类型。这种情况常常不是程序员想要的结果,所以,要避免之,就可以这样写:... 阅读全文
posted @ 2014-08-15 10:36 yexuannan 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1、句柄和指针 句柄标记着系统资源,如一个进程的某个窗口 指针标记着物理内存 阅读全文
posted @ 2014-08-12 21:43 yexuannan 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 1、const和define区别 const有数据类型(不能改变的变量),define只是简单的字符串替换,没有数据类型。 C++程序用const完全取代 define。 const还可以类成员函数为不能改变成员变量的恒态函数。(mutable int a除外) 例子: const int buffsize=10; int buf[buffsize]; 在C编译器中编译出错,因为 ... 阅读全文
posted @ 2014-08-08 16:29 yexuannan 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 1、交换两个数 方法1、a+b有可能越界 a=a+b; b=a-b; a=a-b; 方法二、不会越界 a=a^b b=a^b; a=a^b; 2、extern “C”用法 ( 自己总结: 1、C++语言引用C语言函数时(void fun(int a,int b),void fun(int a,float b)),由于C++有重载功能,编译器按C++的方式编译该函数后产... 阅读全文
posted @ 2014-08-06 23:24 yexuannan 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1、虚函数 http://blog.csdn.net/livelylittlefish/article/details/2171504 2、面试宝典 #include using namespace std; class A { protected: int m_data; public: A(int data=0) {m_data=data; cou... 阅读全文
posted @ 2014-08-04 19:45 yexuannan 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1、堆排序 http://www.cnblogs.com/dolphin0520/archive/2011/10/06/2199741.html 阅读全文
posted @ 2014-07-31 22:35 yexuannan 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 1、word 标题四, 右键更新自己也可以新建标题样式2、数组连续内存,空间复杂度高(即使数组存在一个元素,占据的空间的大小不变),时间复杂度低(0(1)访问),内存分配一次性完成 阅读全文
posted @ 2014-07-30 09:40 yexuannan 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1、关于while((*pa++=*pb++)!='\0')和while((*pa=*pb)!='\0') {pa++;pb++;}的不同#includevoid main(){ char a[]="abcde"; char b[]="gh"; char *pa=a; cha... 阅读全文
posted @ 2014-07-29 20:40 yexuannan 阅读(537) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 14 下一页