-
ifstream
I may be missing something but I have been searching and haven't come up with anything yet... but I can't seem to use ifstream... I tried including (#inclulde <ifstream>) and MinGW puked it back at me saying "ifstream: No such file or directory". So I tried to just include (#include <fstream>) and it includes it then doesn't allow me to use ifstream...
I am using Code::Blocks built Sept 11, 2006 and MinGW 3.4.2...
I am new to Code::Blocks and haven't done much compiling via commandline with MinGW.
-
Maybe try <istream.h> or <ostream.h>
-
But what gets me is the inablity to use ifstream... which is typedef'd in iosfwd.h which is included in ios.h which is included in istream.h which is included in fstream... (the .h's may be off since I am going by memory due to that computer being reset atm.)
-
Mmm, this seems OK with cygwin g++
Code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main(void) {
ifstream foo("new.c");
char c = foo.get();
cout << "First char is " << c << endl;
foo.close();
}