code
C
debug
在建構時向heap區申請空間,卻沒有在構析函數時釋放
heap
g++ -o main -Wall -ggdb3 main.cpp valgrind --leak-check=full ./main
此時terminal可顯示可能出錯在第幾行。
terminal
file main
結尾出現..., with debug_info, not stripped 在輸入以剝掉一些符號和除錯訊息。
..., with debug_info, not stripped
strip hw26
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up