随笔分类 -  c

摘要:https://blog.csdn.net/leixiaohua1020/article/details/44243155 阅读全文
posted @ 2019-09-04 13:06 MoonXu 阅读(284) 评论(0) 推荐(0) 编辑
摘要:ar -t /usr/lib/x86_64-linux-gnu/libc.a 查看libc.a中包含的目标文件 visual c++提供类似的功能lib.exe ar -x /usr/lib/x86_64-linux-gnu/libc.a 将libc.a解压到当前目录 默认的链接脚本是在/usr/l 阅读全文
posted @ 2019-08-28 09:51 MoonXu 阅读(233) 评论(0) 推荐(0) 编辑
摘要:crt1.o, crti.o, crtbegin.o, crtend.o, crtn.o 等目标文件和daemon.o(由我们自己的C程序文件产生)链接成一个执行文件。前面这5个目标文件的作用分别是启动、初始化、构造、析构和结束,它们通常会被自动链接到应用程序中。例如,应用程序的main()函数就是 阅读全文
posted @ 2019-08-26 14:33 MoonXu 阅读(1560) 评论(0) 推荐(0) 编辑
摘要:fwrite(),最好写strlen()个字节,否则可能有乱码 阅读全文
posted @ 2019-08-23 19:03 MoonXu 阅读(113) 评论(0) 推荐(0) 编辑
摘要:fwrite()不用写字符串结束标志 fwrite(buf, 1, strlen(buf), fp);//正确 fwrite(buf, 1, strlen(buf) + 1, fp);//正确 阅读全文
posted @ 2019-08-22 18:02 MoonXu 阅读(898) 评论(0) 推荐(0) 编辑
摘要:main中调用pthread_exit(),这样进程就必须等待所有的线程终止后才能退出 如果你希望初始线程终止时,其他线程继续执行,需要在初始线程中调用pthread_exit(),而不是从main()函数中返回。 阅读全文
posted @ 2019-08-22 11:03 MoonXu 阅读(365) 评论(0) 推荐(0) 编辑
摘要:*** stack smashing detected ***: <unknown> terminatedAborted (core dumped) tack-Smashing Protector”机制(在数组后插入一些金丝雀(Canary, 因为大家在矿井作业时,会用金丝雀来预警,如果金丝雀死了, 阅读全文
posted @ 2019-08-21 21:28 MoonXu 阅读(711) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/wwjyt/p/3182892.html 阅读全文
posted @ 2019-08-19 11:07 MoonXu 阅读(84) 评论(0) 推荐(0) 编辑
摘要:1. bcmp(3) 类ma似于strncmp(3) 但是比较结果不一定是两个字符的ascii码之差。 返回值:相等0,不相等非零(不一定是-1) 2.bcopy(3)类ma似于strncpy(3) 返回值:没有返回值 不检查NULL 3.bzero(3) bcmp bcopy bzero bcmp 阅读全文
posted @ 2019-08-12 22:05 MoonXu 阅读(151) 评论(0) 推荐(0) 编辑
摘要:strdup(3) 阅读全文
posted @ 2019-08-12 10:07 MoonXu 阅读(87) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/caigen1988/article/details/7901248 阅读全文
posted @ 2019-08-09 17:50 MoonXu 阅读(232) 评论(0) 推荐(0) 编辑
摘要:在Linux系统中,进程作为系统资源分配的最小单位,而线程作为系统调度的最小单位。也就是说,线程更加接近执行体的概念。但是线程和进程各自有优缺点,进程方便系统资源的管理与维护,但是执行创建进程的系统开销较大,通常为线程创建系统开销的几百倍,而线程则刚好相反,线程的系统开销小,并发性更好。因此线程是一 阅读全文
posted @ 2019-08-09 15:59 MoonXu 阅读(116) 评论(0) 推荐(0) 编辑
摘要:backtrace(简写为bt命令查看函数调用的栈帧: nfo(简写为i)查看函数中局部变量的值: i locals 查看函数当前局部变量的值用frame(简写为f)选择1号栈帧然 frame 1 可以利用finish命令让程序一直运行到从当前函数返回为止 continue(简写为c)命令运行到程序 阅读全文
posted @ 2019-08-05 17:37 MoonXu 阅读(196) 评论(0) 推荐(0) 编辑
摘要:xpy@ubuntu:~/kj/mxml$ ./a.out./a.out: error while loading shared libraries: libmxml.so.1: cannot open shared object file: No such file or directory 解决 阅读全文
posted @ 2019-08-05 09:46 MoonXu 阅读(135) 评论(0) 推荐(0) 编辑
摘要:INT_MAX UINT_MAX ATTRIBUTE_UNUSED 阅读全文
posted @ 2019-08-02 15:52 MoonXu 阅读(114) 评论(0) 推荐(0) 编辑
摘要:xml.h:97:8: error: variable ‘xmlEntityAmp’ has initializer but incomplete type struct xmlEntity xmlEntityAmp = { 定义变量的时候首先看一下,变量在之前是否声明 阅读全文
posted @ 2019-07-31 17:32 MoonXu 阅读(148) 评论(0) 推荐(0) 编辑
摘要:__attribute__ 可以设置函数属性(Function Attribute )、变量属性(Variable Attribute )和类型属性(Type Attribute ) aligned: struct S { short b[3];}__attribute__ ((aligned (2 阅读全文
posted @ 2019-07-29 18:08 MoonXu 阅读(715) 评论(0) 推荐(0) 编辑
摘要:__strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:3131 ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: No such fi 阅读全文
posted @ 2019-07-29 14:10 MoonXu 阅读(2293) 评论(1) 推荐(1) 编辑
摘要:/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h 阅读全文
posted @ 2019-07-19 18:04 MoonXu 阅读(308) 评论(0) 推荐(0) 编辑
摘要:#在PATH中找到可执行文件程序的路径。export PATH =$PATH:$HOME/bin在文件/etc/profile中加入#gcc找到头文件的路径C_INCLUDE_PATH=/usr/include/libxml2:/MyLibexport C_INCLUDE_PATH#g++找到头文件 阅读全文
posted @ 2019-07-18 16:46 MoonXu 阅读(2635) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示