私はグーグルが見つかりましたが、見つからない中括弧などと何か関係があると思いますが、このブラケットがどこにないのかわかりません。 C++で致命的なエラーC1004:予期しないファイルの終わりが見つかりました
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
using namespace std;
class Something{
static DWORD WINAPI thread_func(LPVOID lpParameter)
{
thread_data *td = (thread_data*)lpParameter;
cout << "thread with id = " << td->m_id << endl;
return 0;
}
int main()
{
for (int i=0; i< 10; i++)
{
CreateThread(NULL, 0, thread_func, new thread_data(i) , 0, 0);
}
int a;
cin >> a;
}
struct thread_data
{
int m_id;
thread_data(int id) : m_id(id) {}
};
}
「main」がクラスにラップされているのはなぜですか? – Mahesh
ここから例を得ました:http://stackoverflow.com/questions/4768294/multithreading-in-c – mezamorphic
私はそれをクラスにラップする必要があると思いましたか? – mezamorphic