Howdy, Stranger!

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


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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

jedi06jedi06 Posts: 38Member
int main(){

string filename;

ifstream inFile;;

//operations here.



  • dwccgcdwccgc Posts: 576Member
    [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.