【发布时间】:2010-09-29 00:21:07
【问题描述】:
我想做这个简单的代码工作。
#include <iostream>
#include <windows.h>
void printSome (int i)
{
std::cout << i << std::endl;
}
void spawnThread (void (*threadName)(int i))
{
CreateThread
(
0, // default security attributes
0, // use default stack size
(LPTHREAD_START_ROUTINE)threadName, // thread function name
(LPVOID)i, // argument to thread function
0, // use default creation flags
0 // returns the thread identifier
);
}
int main ()
{
spawnThread(printSome(155));
}
我在windows上,使用vs。任何帮助都会非常感激。
【问题讨论】:
-
那么到底是什么问题?
标签: c++ windows multithreading function pointers