#include "process.h"
#include "windows.h"
class test
{
private:
int a;
int b;
public:
test()
{
}
static void loop(void * argslist )
{
int val=a; //如何才能在类中的静态函数中使用类的成员变量
while(1)
{
Sleep(1000);
}
}
int StartThread()
{
return _beginthread(loop,0,NULL); //或者有没有办法在启动线程的时候使用类的成员函数?
}
};
int main()
{
test *t= new test();
t->StartThread();
return 0;
}