The first thing you need to do is check your computer's file system and see if the file name you enter is in the same directory as where your program is running. If it is somewhere else then you need to specify the full path to the file, such as c:\Prograzm Files\somethere. If the path and/or filename contains spaces, as I posted, then you can use the >> operator of cin, but you will have to use getline().
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
If Norton were the cause then you would have gotton a Norton error message. If file.open() fails the only reason on MS-Windows is that the file is not in the directory you think it is. What compiler are you using?
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I got that stupid message too, so I disabled it. If you are running Norton 360, click that green tool on your desktip and it will bring up a Norton window. On that window select menu item Settings, then Antivirus link. From there you can turn off SONAR Protection.
With VC++ 2010 Express (which I also use) you have to put the file you want to open in the same folder as the program's *.cpp files.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343