Hello,
I am trying to write a program that opens a file; reads through it; outputs the text; then outputs the number of lines, words, and characters.
Problem is, every time I try to compile, no matter what modifications I make, I get an error, "line 42: Error: Could not find a match for std::basic_istream<char, std::char_traits<char>>::get(int)."
I have tried everything I can think of. Help?
#include <iostream>
#include <fstream>
using namespace std;
int algorithm(void);
int code(string);
int initialize(int&, int&, int&);
int processBlank(int&, char&);
int copyChar();
int printTotal();
int main(){
char ch;
string word, line;
int lcount, ccount, wcount;
int initialize();
// algorithm(); USED IN BUILD FILE
// code("text.cpp"); USED IN BUILD FILE
ifstream inFile;
inFile.open("/export/home/wyatt/public_html/!Data/simple.txt");
processBlank(lcount, ch);
inFile.close();
cout << "Lines: " << lcount << endl;
return 0;
}
int initialize(int &lcount, int &ccount, int &wcount){
lcount = 0;
ccount = 0;
wcount = 0;
return 0;
}
int processBlank(int &lcount, int &ch){
ifstream inFile;
inFile.open("/export/home/wyatt/public_html/!Data/simple.txt");
while (! inFile.eof()){
inFile.get(ch); <---------------- Line in question
if (ch == '\n'){
lcount++;
}
}
return 0;
}