Monday, May 24, 2010

Question about visual C++.?

Here is the code:


// my first program in C++





#include %26lt;iostream%26gt;


#include %26lt;cstdlib%26gt;


#include "stdafx.h"


using namespace std;





int _tmain(int argc, _TCHAR* argv[])


{


cout %26lt;%26lt; "Hello World!";


return 0;





}








the error:


1%26gt;Compiling...


1%26gt;std.cpp


1%26gt;c:\users\hong wei\documents\visual studio 2005\projects\ok\ok\std.cpp(6) : error C2871: 'std' : a namespace with this name does not exist


1%26gt;c:\users\hong wei\documents\visual studio 2005\projects\ok\ok\std.cpp(10) : error C2065: 'cout' : undeclared identifier


1%26gt;Build log was saved at "file://c:\Users\Hong Wei\Documents\Visual Studio 2005\Projects\ok\ok\Debug\BuildLog.htm"


1%26gt;ok - 2 error(s), 0 warning(s)





so how to fix it i am using visual c++ express

Question about visual C++.?
what have u typed in stdafx.h file and stdafx.cpp files


its the basic problem and go to mdsn site to resolve it
Reply:http://forums.microsoft.com/MSDN/ShowPos...


No comments:

Post a Comment