Ok, so ive had this really annoying problem with Visual C++. It bugs me because it doesnt make any logical sense. something i guess we need to program. Anyway, Visual C++ reckons that the datatype "string" isnt defined, even though it is in the included library string. If i right click the underlined "string" and click "go to definition", however. It sends me to xstring, where it is defined. It wouldnt bother me except the program doesnt compile.

I do program on vis c++ and this problem rarely crops up, but it keeps on stopping me in my tracks and its annoying. Please look at the attatched JPEG to get an idea about what im talking about.

Thanks Guys

Recommended Answers

All 3 Replies

string lives in the std namespace, so e.g. std::string input; ought to work.

"::" is the scope resolution operator.

namespace::class is the form of std::string.

ahh thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.