C++线程小例子
#include <vector> #include <boost/progress.hpp> #include <boost/thread.hpp> #include <Windows.h> #include <map> #include <sstream> #include <iostream> #include <hash_map> #include "CSHOW.H" using namespace boost; using namespace std; void PutDatas(int nData, float fPrice) { while(true) { Sleep(1000); cout << "我是中国人" ; } } int main() { boost::thread(PutDatas, 100, 132.1f); int wait; cin >> wait; }