![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
自己小编码
舒夜潇潇忆情
2018-09-10到2021-07-04 看完147本书
展开
-
使用引用交换两数
#include using namespace std; void main() { int c = 1; int d = 2; swap(c,d); //这里使用swap(&c,&d)是错误的 cout } void swap(int &a,int &b) { int temp = 0; temp = a; a = b; b原创 2015-01-29 14:21:28 · 406 阅读 · 0 评论 -
各知识点1
#include #include using namespace std; class Person { public : virtual void say() { cout } virtual void unknown1() = 0; }; class Programer:public Person { private :原创 2015-01-29 14:39:43 · 359 阅读 · 0 评论 -
实现strcpy函数及其长度
#include char* strcpy(char *strDest, char *strSrc) { if((strDest == NULL)||(strSrc == NULL)) { return NULL; } char *strDestCopy = strDest; while((*strDest++ = *strSrc++) != '\0'); return strD原创 2015-02-15 17:01:02 · 748 阅读 · 0 评论 -
冒泡排序
#include using namespace std; int main() { int a[10] = {4,5,8,2,7,3,9,5,7,1}; // int m = sizeof(a); for (int j = 10; j > 0 ;j --) { for( int i = 0; i < j; i++) { if(a[i] > a[i+1]) {原创 2015-03-06 15:54:46 · 351 阅读 · 0 评论 -
内存赋值memcpy实现
#include #include void *memcpy(void *memTo, const void *memFrom, size_t size) // typedef unsinged int size_t 其大小足以保证存储内存中对象的大小 { assert((memTo != NULL) && (memFrom != NULL)); char *tempFrom = (原创 2015-02-15 17:20:40 · 1246 阅读 · 1 评论