2

我收到一条错误消息,说没有匹配函数调用涉及 getline(tokenizer, " "); 的“getline”。我不知道如何解决这个问题,我尝试过包含其他一些标题,但我只是不断提出更多错误。

#include <iostream>
#include <fstream>
#include <cstring>
#include <sstream>
#include <string>


using namespace std;

char encrypt(char character, int offset);

int main(int argc, char *argv[]) {

ifstream inputFile;
string str;
string token;
bool debug = true;
int lineLength = 0, offset;

inputFile.open(argv[1]);
if (inputFile.fail())
    cout << "File failed to open. \n";

istringstream tokenizer(str);
getline(tokenizer, " ");
offset = token.length();

while (getline(inputFile, str)){
    lineLength = str.length();

    for (int i = 0; i < lineLength; i++)
        str.at(i) = encrypt(str.at(i), offset);

    cout << str << endl;
}

inputFile.close();
return(0);
}
4

0 回答 0