F
Flykiller
I have the following code:
string line1 ;
ifstream fin ;
ofstream fout ;
fin.open("inputfile.txt") ;
fout.open("outputfile.txt") ;
while (getline(fin,line1))
fout << line1 << etc ;
fin.close() ;
fout.close() ;
fin.open("outputfile.txt") ;
at this point outputfile.txt exists, and has data I expect and want, but fin
opens at EOF. I can't read anything out of outputfile.txt. I've tried
fin.open('outputfile.txt", ios::in), same result. I've never seen this before,
and neither has anyone I've been able to talk to. this is on linux using g++.
if someone can point out what I'm doing wrong, or how to work around this, I'd
appreciate it.
if it's relevant, the machine I'm using also has the following problem. it
compiles this:
int main()
{
using namespace std ;
}
but does not compile this:
using namespace std ;
int main()
{
}
string line1 ;
ifstream fin ;
ofstream fout ;
fin.open("inputfile.txt") ;
fout.open("outputfile.txt") ;
while (getline(fin,line1))
fout << line1 << etc ;
fin.close() ;
fout.close() ;
fin.open("outputfile.txt") ;
at this point outputfile.txt exists, and has data I expect and want, but fin
opens at EOF. I can't read anything out of outputfile.txt. I've tried
fin.open('outputfile.txt", ios::in), same result. I've never seen this before,
and neither has anyone I've been able to talk to. this is on linux using g++.
if someone can point out what I'm doing wrong, or how to work around this, I'd
appreciate it.
if it's relevant, the machine I'm using also has the following problem. it
compiles this:
int main()
{
using namespace std ;
}
but does not compile this:
using namespace std ;
int main()
{
}