致命错误C1004:发现意外的文件结尾
fatal error C1004: unexpected end-of-file found
我收到了上面的错误消息(我在谷歌上搜索了一下,发现这与缺少大括号或其他什么有关),但是,我看不到这个缺少的括号在哪里?
#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) {}
};
}
在C++中,class
关键字需要在右大括号后加一个分号:
class Something {
}; // <-- This semicolon character is missing in your code sample.
您的类Something
需要有一个终止分号。
class Something{
}; // missing
在class Something
定义的右大括号(}
)后面需要一个分号(;
)
您可能错过了
#ifdef ROCKSTAR
#endif <--- this might be missing
相关文章:
- 在C++中使用 freopen 时如何检测文件结尾?
- 如何在 的开头<x>和结尾<y>之间更改带有文件输出的字符串的值
- 以 Null 结尾的字符串的"NULL"或" "符号是否存储在文件中?
- 如何在图像位中设置标志以标记音频文件的结尾
- 如何在C++中打开以特定扩展名结尾的文件
- 如何将EOF(文件结尾)放入代码::块中?
- 用 OpenCV 以文件结尾分隔
- 将头文件(.h)放在另一个文件(.h或.cpp)的开头和结尾之间的区别
- 超级强大的API-超级强大的Decoder::decode未为文件结尾返回0
- 处理导致核心转储的文件结尾错误
- 我对文件结尾感到困惑
- 如何检查 ifstream 是否是 C++ 中文件的结尾
- C++ lcov 到达了意外的文件结尾
- 如何检测 C++ 中字符串输入的文件结尾
- 意外的文件结尾(可视形式)
- [C++]检查文件结尾
- 如何处理CSV文件中多个可能的文件结尾
- 致命错误C1004:发现意外的文件结尾
- 发现OpenMP和VS 2012意外的文件结尾
- 意外的文件结尾错误