16,473
社区成员
发帖
与我相关
我的任务
分享
AfxBeginThread(boost::bind(&CTransmitServerDlg::CloseServer, this), this);
class myclass
{
protected:
string name_;
public:
myclass()
: name_("hello world")
{
}
void work()
{
for(int i=0;i<100;i++)
{
cout << name_ << endl;
Sleep(10);
}
}
}
int main()
{
myclass c;
boost::thread thd(boost::bind(&myclass::work,&c));
thd.join();
}