Here is a simple code:
in VC++6, it passed compling and linking all right. If use <iostream> to replace <iostream.h>, the vc6 prompts:Code:// abc.cpp # include<iostream.h> void main() { int a=1,b=2,c; c=a+b; cout<<"c="<<c<<endl; }
error C2065: 'cout' : undeclared identifier
error C2065: 'endl' : undeclared identifier
BUT in VC7, use <iostream.h>, it says:
fatal error cannot open include file 'iostream.h': no such file or directory.
If changed to <iostream>, it says:
Error c2065: 'cout': undeclared identifier.
Error c2065: 'endl': undeclared identifier.
What is the reason? How deal with?