Fatal Error C1004: Unexpected End of File Found

I get the above error message (which I searched on googled and found something to do with the missing curly brace or something else), but I can not see where this missing bracket is?

#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) {} }; } 
+6
source share
3 answers

In C ++, the class keyword requires a semicolon after the closing bracket:

 class Something { }; // <-- This semicolon character is missing in your code sample. 
+21
source

Your Something class must have a trailing semicolon.

 class Something{ }; // missing 
+5
source

You need a semicolon ( ; ) after closing ( } ) the definition of class Something

+2
source

Source: https://habr.com/ru/post/912239/


All Articles