If you're trying to do
system( "cd \\the\\yellow\\brick\\road" );
ifstream fin( "lion.txt" );
then you're going about it all wrong. Any changes you make inside system() are localised to the sub-process which is created (and then lost almost immediately). The current directory seen by ifstream isn't at the end of the yellow brick road.
If you really want to open a file in another directory, then you need something like
chdir( "\\the\\yellow\\brick\\road" );
ifstream fin( "lion.txt" );
or
ifstream fin( "\\the\\yellow\\brick\\road\\lion.txt" );
But note that chdir() is a concept here, you need to find the actual name of the function which matches your OS/Compiler.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953