Click to See Complete Forum and Search --> : fstream


Maximilian
August 6th, 2004, 03:23 PM
Hi. I got a little problem with fstream.. im running VS .NET 2003 and i'm about to do some customization of a app made in VS 6.0.. in this app i'm using ofstream to open a file but for some reason when compiling i get this error " C2065: 'ofstream' : undeclared identifier" Does VS 2003 not support the use of fstream or do i have to alter my code in some way to make it work?

hope that some of you can bring some light into this!

Maximilian
August 6th, 2004, 03:47 PM
I tried writing

std::ifstream myfilename

but then I got this error "C2039: 'ifstream' : is not a member of '_STL'"

I'm very confused.. Is it a setting in my Visual Studio that i have to correct?

please help!!

Andreas Masur
August 7th, 2004, 04:53 AM
Did you include the necessary header file?

#include <fstream>

std::ifstream File("test.txt");