摘要: 主内存中内存单元(比特)有唯一编号,可寻址。c语言中变量可占用连续几个比特,那么有几种办法定位变量占用的地址? 变量名,引用,指针都是地址的别名 int num = 5; 1, 直接变量名的地址,一阶指针 int *r1 = # *r1是num的内容,r1内指向num的地址。 2, 取地址+ 阅读全文
posted @ 2023-07-14 18:15 安然春夏 阅读(55) 评论(0) 推荐(0)
摘要: 查看c/c++文件中的头文件,可以使用gf跳转,但是有时会出现Error 447:not found in path1, 命名模式中输入,临时修改 :set path=.,/usr/include,,/usr/include/c++/*/ 2, 修改vimrc set path+=.,/usr/in 阅读全文
posted @ 2023-07-14 15:43 安然春夏 阅读(117) 评论(0) 推荐(0)
摘要: #include<typeinfo> int main(){ int i=5; int &ir=i; std::cout<<typeid(ir).name()<<std::endl; // output: i return 0; } 阅读全文
posted @ 2023-07-14 15:29 安然春夏 阅读(14) 评论(0) 推荐(0)
摘要: g++也可以编译c语言函数, 1 // filename: extern_c.cc 2 3 #include <iostream> 4 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 //c语言语句开始 9 #include <stdio.h> 10 1 阅读全文
posted @ 2023-07-14 14:15 安然春夏 阅读(17) 评论(0) 推荐(0)
摘要: cpplint可用于检查代码是否遵守google c++代码规范。我的理解是检查你使用的是不是正确的C++。 安装: python3 -m pip install cpplint 与之对应,代码需要格式化为满足google c++规范的格式,比如使用 clang-format --style=goo 阅读全文
posted @ 2023-07-10 20:58 安然春夏 阅读(1099) 评论(0) 推荐(0)
摘要: 包括masm.exe和link.exe 链接: https://pan.baidu.com/s/13aRSljcSt9yPJuV5WhpMww 提取码: buwf 阅读全文
posted @ 2023-06-17 10:55 安然春夏 阅读(127) 评论(0) 推荐(0)
摘要: 1. gdb [GDB调试教程:1小时玩转Linux gdb命令] sudo dnf debuginfo-install glibc-2.32-2.fc33.x86_64 编译时, gcc -g test.c -o test,因为在调试二进制文件的时候,我们需要在二进制文件中加入调试信息,而调试信息 阅读全文
posted @ 2023-06-11 20:22 安然春夏 阅读(86) 评论(0) 推荐(0)
摘要: 环境:fedora 38 xfce desktop 安装依赖改为: dnf install libX11-devel SDL_ttf-devel SDL_gfx-devel 但是检测到内存泄漏: 5140==ERROR: LeakSanitizer: detected memory leaksSUM 阅读全文
posted @ 2023-06-04 00:18 安然春夏 阅读(81) 评论(0) 推荐(0)
摘要: Fedora 38安装VirtualBox, 官网[1]没有这个版本的安装。调查发现[2]中要求更新kernel, 不想。 但是[3]有方法可行,Install Howto: Create the repository config file /etc/yum.repos.d/virtualbox. 阅读全文
posted @ 2023-05-30 23:07 安然春夏 阅读(101) 评论(0) 推荐(0)
摘要: 不知道为啥xfce不默认安装orage。按照官网https://docs.xfce.org/apps/orage/start#latest_release,记录安装过程。 1, 下载源码,https://mirror.netcologne.de/xfce/src/apps/orage/4.18/or 阅读全文
posted @ 2023-05-23 21:16 安然春夏 阅读(68) 评论(0) 推荐(0)