ya4599 2021-08-10 18:50 采纳率: 0%
浏览 45

C++ 多线程内存泄漏问题

问题如题,


#include "stdafx.h"
#include <string>
#include <thread>
#include <iostream>
using namespace std;
void fun(int a )
{
    std::cout<<a<<std::endl;
}

int _tmain(int argc, _TCHAR* argv[])
{
    thread t1(fun,8);
    t1.join();
    system("pause");
    return 0;
}

img

  • 写回答

1条回答 默认 最新

  • 山水一 2021-08-13 16:33
    关注

    不用预编译,运行正常
    img

    img

    评论

报告相同问题?

问题事件

  • 创建了问题 8月10日