上一页 1 2 3 4 5 6 7 8 9 10 ··· 36 下一页

2021年8月4日

摘要: 转自 http://c.biancheng.net/cpp/html/156.html memcpy 用来复制内存内容 void * memcpy ( void * dest, const void * src, size_t num ); 并不关心被复制的数据类型,只是逐字节地进行复制,这给函数的 阅读全文
posted @ 2021-08-04 17:24 lodger47 阅读(37) 评论(0) 推荐(0)

2021年8月2日

摘要: 全缓冲: 全缓冲的典型代表是对磁盘文件的读写 行缓冲: scanf. printf. 都是行缓冲,等按下回车键换行时才进行实际I/O操作 不带缓冲: 也就是不进行换从,标准错误情况stderr是典型代表 scanf %d 忽略 空格 和 \n scanf 成功返回元素个数,失败返回0 #includ 阅读全文
posted @ 2021-08-02 06:59 lodger47 阅读(42) 评论(0) 推荐(0)
摘要: 打印99乘法表 字符串反转 递归调用 打印99乘法表 #include <stdio.h> int main() { int i,j; for (i = 1; i < 10; ++i){ for (j = 1; j <= i; ++j) printf("%d x %d = %d\t",j,i,i*j 阅读全文
posted @ 2021-08-02 05:58 lodger47 阅读(24) 评论(0) 推荐(0)

2021年8月1日

摘要: 用有效数字位来比较浮点数 #include <stdio.h> int main() { float b = 1.456; if(b-1.456 > -0.000001 && b-1.456<0.000001) printf("b is equal to 1.456\n"); else printf 阅读全文
posted @ 2021-08-01 15:36 lodger47 阅读(101) 评论(0) 推荐(0)

2021年7月31日

摘要: ![](https://img2020.cnblogs.com/blog/1843414/202107/1843414-20210731072249592-1383678914.png) ![](https://img2020.cnblogs.com/blog/1843414/202107/1843414-20210731072521300-99076203.png) ![](https://im 阅读全文
posted @ 2021-07-31 07:26 lodger47 阅读(170) 评论(0) 推荐(0)
摘要: 编译可执行文件时需要加上 -g cgdb 执行的两种方式 gdb xxx gdb xxx core文件 交互命令 参数 描述 run 简写 r 运行程序 start 会自动停止到main函数开始位置 next n 执行下一行 step s 单步执行,会进入函数 continue c 继续执行,到下一 阅读全文
posted @ 2021-07-31 06:44 lodger47 阅读(37) 评论(0) 推荐(0)

2021年7月30日

摘要: %x、%X、%#x、%#X 的区别(因为调试的时候经常要将内存中的二进制代码全部输出,然后用十六进制显示出来) #include <stdio.h> int main() { int i ='a'; printf("00 1--%x\n",i); //00 1--61 printf("02 2--% 阅读全文
posted @ 2021-07-30 13:48 lodger47 阅读(62) 评论(0) 推荐(0)
摘要: TCP篇 GameChannel.h #include <ZinxTCP.h> #include "GameProtocol.h" class GameChannel :public ZinxTcpData { public: GameChannel(int _fd):ZinxTcpData(_fd 阅读全文
posted @ 2021-07-30 10:45 lodger47 阅读(434) 评论(0) 推荐(0)

2021年7月29日

摘要: 首先 /var/ftp/pub 为满权限 其次 从配置文件下手 anonymous_enable=YES local_enable=YES write_enable=YES anon_root=/var/ftp anon_upload_enable=YES anon_mkdir_write_enab 阅读全文
posted @ 2021-07-29 17:44 lodger47 阅读(177) 评论(0) 推荐(0)
摘要: eventfd 在内核版本,2.6.22以后有效。查看内核版本可以用命令 uname -r 。 原型 #include <sys/eventfd.h> int eventfd(unsigned int initval, int flags); /** * initval: 创建eventfd时它所对 阅读全文
posted @ 2021-07-29 07:25 lodger47 阅读(230) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 36 下一页

导航