编辑
2023-12-09
技术
0

firstly. test cpp file show below.

cpp
// t.cpp #include <iostream> #include <stdio.h> int main() { char* c = NULL; printf("%d", *c); return 0; }

to check if the coredump enabled in your system by.

shell
ulimit -c // return 0 if disable. ulimit -c unlimited // this command will enable the coredump feature.

use g++ to compile the program with -g option.

shell
g++ -g t.cpp -o t.o // complile ./t.o // this command will run into fail // message is "Segmentation fault (core dumped)" // and a file named "core" is generated.

now you can use gdb to debug the code.

shell
gdb t.o core

done !

编辑
2023-11-13
技术
0
编辑
2023-10-29
技术
0

代码:

#include<iostream> using namespace std
编辑
2023-10-26
日常
0

![20200119145417764.png](https://santi.pub/static

编辑
2023-10-19
技术
0
cpp
//回调函数的简单理解 //例子温度计显示温度。 //有两种方式 // 1. 睡眠5