我正在使用 VC2010,并编写以下代码来测试“__beginthreadex”
#include <process.h>
#include <iostream>
unsigned int __stdcall threadproc(void* lparam)
{
std::cout << "my thread" << std::endl;
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
unsigned uiThread1ID = 0;
uintptr_t th = _beginthreadex(NULL, 0, threadproc, NULL, 0, &uiThread1ID);
return 0;
}
但是没有任何东西打印到控制台。我的代码有什么问题?