sample code
can run in visual c++ 2012
// threadtest.cpp : 定義主控台應用程式的進入點。
//
#include "stdafx.h"
#include <iostream>
#include <thread>
using namespace std;
int gg=0;
void function_1(int a,int b, int c ){
std::cout<<"test string"<<endl;
std::cout<<a<<" "<<b<<" "<<c<<endl;
std::cout<<"gg ="<<gg<<endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
gg=5;
thread t1(function_1,1,2,3);
t1.join();
return 0;
}