We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问:在《第3节:解析字符串解答篇》的 1A. Windows 下的内存泄漏检测方法 中提到的 C Runtime Library(CRT) 检测内存泄漏 我在Windows10系统,VS2019下面运行一下代码,为什么没有提示内存泄露?
1A. Windows 下的内存泄漏检测方法
C Runtime Library(CRT) 检测内存泄漏
#include <iostream> #define _WINDOWS #ifdef _WINDOWS #define _CRTDBG_MAP_ALLOC #include <crtdbg.h> #endif typedef struct Node { int d[10]; }Node; int main() { #ifdef _WINDOWS _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif Node* node1 = new Node(); Node* node2 = (Node*)malloc(sizeof(Node)); std::cout << node1->d[0] << std::endl; std::cout << node2->d[0] << std::endl; _CrtDumpMemoryLeaks(); }
Linux环境下同样不行?
The text was updated successfully, but these errors were encountered:
我也是遇到了相同的情况,请问你现在有答案了吗?
Sorry, something went wrong.
有提示的,在输出那里
No branches or pull requests
请问:在《第3节:解析字符串解答篇》的
1A. Windows 下的内存泄漏检测方法
中提到的C Runtime Library(CRT) 检测内存泄漏
我在Windows10系统,VS2019下面运行一下代码,为什么没有提示内存泄露?
Linux环境下同样不行?
The text was updated successfully, but these errors were encountered: