After ‘building’, Visual Studio says about line 2: "Cannot open source file ifstream", and "Cannot open include file: 'ifstream': No such file or directory"
There are similar messages about line 3.
Please can someone tell what is wrong with these two lines?
Edit: It's worth asking, where did you find the code? On a random comment in an MSDN forum post? Or an actual codebase?
It seems there did used to be pre-standard headers in compilers a long time ago, like g++, where <ifstream.h> was a thing, but I can't find anything specifically about <ifstream>. So jonnin might also be correct, you might be looking at source code used with a gosh darn old compiler.
I have found references to ifstream and ofstream in at least one book and examples on the web.
I'm using the 'community' version of Visual Studio which has been downloaded and installed quite recently but compared with other versions may be "very very old".
compared with other versions may be "very very old".
I was talking about pre year 2000, back before the no .h header file syntax.
the community edition is just fine.
post a small example of what you are doing that isnt working and let us see if we can spot the issues if you still need help.