fstream - Very basic C++ error -


O people, I am writing the simplest thing, to create an event to read in just one text file and The odd error near here is the code (note: missing '& lt;;' for iostream and fstream is written well in my code but I can not write them here)

  # Include "genlib.h" # "Simpio.h" # Include "random.h" #include "vector.h" # "map.h" # Include # include & lt; Iostream & gt; #include & lt; Fstream & gt; Int main () {ifstream in; In.open ("Hamlet.txt"); If (in.fail ()) error ("file can not be opened"); Return 0; }  

I get the following error after the event;

thanks

what is wrong with any one is?

only unusual past ifstream in; This is the error call my wild guess is that it's a poorly written macro. Try it instead:

  int main () {ifstream in; In.open ("Hamlet.txt"); If (in.fail ()) {error ("file could not be opened"); } Return 0; }  

Error .


Comments