I am doing a C++ program for school which is supposed to take letters from an input file and output them in a file. the input file has words with various number of spaces between them. The program is supposed to output the words with just one space between them, like a normal sentence. I have it all written up, the main codes are
while (! infile.eof())
( if (c != ' ')
skip(infile, outfile, c);
void skip(ifstream& infile, ofstream& outfile, char& c)
while (c == ' ')
every time I run it, it just ends up skipping all the spaces. If anyone can help me out, I'd really appreciate it, thanks!