이상한 C3681 오류가 발생하여 내 기능 중 하나에서 식별자를 찾을 수 없다는 메시지가 계속 나타납니다. 나는 매우 혼란스럽고 Google을 사용하면서 발견 된 해결책을 시도했지만, 해결할 수는 없습니다. stl을 사용하지 않는 것이 좋습니다.C++에서 빌드 오류 얻기
오류 :
오류 1 오류 C3861 : 'readTheStuff': 식별자를 찾을 수 없습니다 C : \ 사용자 \ XXXXXX \ 바탕 화면 \ 데이터 구조 \ homework2 \ homework2 editor.cpp \ 38 일 Homework2
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int readFile(const char *fileName) {
ifstream myReadFile;
string line;
int i = 0;
myReadFile.open(fileName);
if (myReadFile.is_open()) {
while (!myReadFile.eof()) {
getline(myReadFile, line);
line += " "; //adds a space after every line
//cout << line << endl;
readTheStuff(line);
}
}
myReadFile.close();
return 0;
}
void readTheStuff(string command){
cout << command; //testing
}
int main(int argc, const char* argv[]){ //when they call, going to pass two parameters
if (argc > 2){
cout << "Error, more than one file given" << endl;
}
else if (argc < 2){
cout << "Error, no file given" << endl;
}
else if (argc == 2){
readFile(argv[1]);
}
}