Error: IntelliSense: name must be a namespace name
Problem code:
using namespace std;
Solution:
#include <iostream>
using namespace std;
using namespace std;
This Visual C++ IntelliSense error occurs when you write using namespace std before including a standard header that defines the std namespace, so the compiler has no namespace to refer to.
Adding the relevant include, such as iostream, before the using directive resolves it. Order matters: headers must be included so the names they declare exist.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.