ofstream outfile;
and then:
outfile.open(“blah[…]”, ios :: out);
i mean, you’ve declared the variable ‘outfile’ as being an ofstream class type, which is a class derived from fstream, specially for writing in a file…
oh, and one more thing: if you include the fstream header it’s not neccessary to also include iostream.h, because the fstream header uses the iostream.h, so it will include it automaticly…
All header files should have #ifndef#define so you aren’t including it twice. Not including it in just makes your code more difficult to maniupulate. Say you remove fstream, and use a diffrent header file for file manipulation that dosen’t include iostream?
Its dumb not to include in everything your program relies on.
you are right in a way… but i thought Kaotic should know about this thing… that’s all
and anyway, when you’re writing a program, either you use file manipulation, either you don’t… before you write a piece of code, you make some plans like ‘what is this program going to do and so on’…
anyway (again), it’s no use to talk about #include, i just gave Kaotic some information, his real problem is something else, right?