472,342 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,342 software developers and data experts.

"Error: Could not find a match for" is the bane of my existence right now


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;
processBlank(lcount, ch);
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;
while (! inFile.eof()){
inFile.get(ch); <---------------- Line in question
if (ch == '\n'){

return 0;
Feb 23 '08 #1
2 5677
9,208 Expert Mod 8TB
inFile.get() requires a char&. You do this inside processBlank() but the char& is passed in as an int&. Hence, the error.

Change processBlank() to have a char& argument instead of an int& argument and off you go.
Feb 23 '08 #2
Ah. Of course. How stupid of me.

Feb 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Jay Chan | last post by:
I keep getting the following error message when I run a serie of SQL commands: Server: Msg 9002, Level 17, State 6, Line 15 The log file for...
by: Gary McGill | last post by:
I have a C# solution with a dozen or so projects. There are references between the projects, and these were all added as "Project" references. ...
by: Saso Zagoranski | last post by:
Hi! I have a little search textbox, which goes through a dataset as the user types in the textbox... If the user types "1", then all the fields...
by: Michael Fay in SB | last post by:
A month ago I posted: "I built my application with Access 2003 and made a distribution using the Microsoft Office Access 2003 Developer Extensions....
by: Curious | last post by:
Hi, I'm not sure if this is the right place to post such command issues. If you know a better forum where people respond to messages fairly...
by: dstorms | last post by:
Hi, I'm trying to create a button on a form that: 1. Takes the ComputerID from the form linked to Table 1, 2. Checks Table 2 for a matching...
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a...
by: Jolie Chen | last post by:
I am learning template programming now, and I wrote the following code #include <iostream> #include "Queue.h" using namespace std; template...
by: =?Utf-8?B?U3dhcHB5?= | last post by:
hi, I am working on application in this i am using two files. In first (consider A) file i am calling the function of other file (consider B). In...
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.