_beginthread()在c++中怎么用啊
#include<stdio.h>#include<process.h>inthello(){printf("hello\n");return0;}intmain(){_...
#include <stdio.h>
#include <process.h>
int hello()
{
printf("hello\n");
return 0;
}
int main()
{
_beginthread(hello,0,NULL);
getchar();
return 0;
}
同样的代码 源文件保存成a.c就能运行 保存为a.cpp就编译失败
错误提示:
error C2664: '_beginthread' : cannot convert parameter 1 from 'int (void)' to 'void (__cdecl *)(void *)'
None of the functions with this name in scope match the target type 展开
#include <process.h>
int hello()
{
printf("hello\n");
return 0;
}
int main()
{
_beginthread(hello,0,NULL);
getchar();
return 0;
}
同样的代码 源文件保存成a.c就能运行 保存为a.cpp就编译失败
错误提示:
error C2664: '_beginthread' : cannot convert parameter 1 from 'int (void)' to 'void (__cdecl *)(void *)'
None of the functions with this name in scope match the target type 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询