devxlogo

string.h

Question:
I am a beginner with C++ programming. I was doing fine until I came to the string data type. Here is my problem:

#include #include 

This gives me errors. I know it does not have anything to do with iostream, so what could be wrong with the other header?

Answer:
You’re using the obsolete header names. Use and instead (without the ‘.h’ extension). Also, add the following using directive after the #include statements:

using namespace std;

And this should work.

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Seasoned Architects Evaluate New Tech

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.