我在我的.cpp文件中得到了一小段代码的运行前错误。C++,Visual Studio快速获取奇怪的运行前错误
iFileName
突出显示并且显示“Error:this declaration has no storage class or instance type。”。
iFileName
和iWidth
之间的逗号说:“错误:预期的声明”
右括号说“错误:预期的声明”
#include <iostream>
#include <fstream>
#include "BMPCanvas.h"
#include "Fractal.h"
using namespace std;
BMPCanvas(string iFileName, int iWidth, int iHeight){
filename = iFileName;
width = iWidth;
height = iHeight;
}
有谁知道为什么我会得到有错误?
BMPCanvas :: BMPCanvas? – willll
'#include'? –
@willll当我这样做,错误消失,但'fileName'成为“错误:标识符”fileName“未定义” – user2726232