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