QUOTE(dh000 @ 3 Feb, 2007 - 10:22 PM)

CODE
while (! infile.eof())
{
c = infile.get();
//what is this for???
char c = cin.get();
//this will print what u took on above line and not something u got from infile.get()
cout.put(c);
}
im trying to change a block of text (which in the beginning is just a bunch of jumbled up words) by getting rid of every other letter in that text. so basically, i'm having trouble with the part after while (! infile.eof()).
I am confused about the statement cin.get()

. I am not getting what exactly you are trying to do there. Please explain your inputs and needed output.
What I understood is you want to print every alternate character from the file.
If this is right then you can use some variable which will work as flag for you.
eg
CODE
#include <iostream>
#include <fstream>
using std::fstream;
using namespace std;
int main(int argc, char *argv[])
{
char c;
int flag =0;
ifstream infile("C:\\document01.cry");
if ( !infile )
{
cerr << "File could not be opened" << endl;
exit( 1);
}
while (! infile.eof())
{
c = infile.get();
if(flag == 0)
{
cout.put(c);
flag = 1;
}
else
flag = 0;
}
}
I am expecting this is going on right track, is that?
I hope this will help you in some way.