博客第一篇文章,写点什么呢?为了证明我是程序员,先写个helloword吧,大牛请悄悄地飘走,菜鸟请躲开,我要装13了。
helloword的实现,由于太简单,直接付上代码吧:
#include<iostream>
#include<thread>
using namespace std;
void hello()
{
cout<<"启动线程:"<<"hello word girl"<<endl;
}
int main()
{
thread my_thread(hello);
my_thread.join();
cout<<"主线程:"<<"hello word main!"<<endl;
return 0;
}
#include<thread>
using namespace std;
void hello()
{
cout<<"启动线程:"<<"hello word girl"<<endl;
}
int main()
{
thread my_thread(hello);
my_thread.join();
cout<<"主线程:"<<"hello word main!"<<endl;
return 0;
}