This message was edited by dwccgc at 2006-2-4 9:25:42
: int main(){
:
: string filename;
: cin>>filename;
:
: ifstream inFile;
:
: inFile.open(filename.c_str());
:
: //operations here.
:
: inFile.close();
: )
:
:
from MSDN
ifstream::open(...)
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.