Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How come I can't open file by: string filename;;

jedi06jedi06 Member Posts: 38
int main(){

string filename;

ifstream inFile;;

//operations here.



  • dwccgcdwccgc Member Posts: 576
    [b][red]This message was edited by dwccgc at 2006-2-4 9:25:42[/red][/b][hr]
    : int main(){
    : string filename;
    : cin>>filename;
    : ifstream inFile;
    : //operations here.
    : inFile.close();
    : )

    [b]from MSDN[/b]
    Opens a disk file and attaches it to the streams filebuf object. If the filebuf object is already attached to an open file, or if a filebuf call fails, the ios::failbit is set. If the file is not found, then the ios::failbit is set only if the ios::nocreate mode was used.


Sign In or Register to comment.