Home c++ How to use String?

How to use String?

Author

Date

Category

Trying to make a simple project using WinForms on C++ / CLI. I needed to create a class (I created it in .cpp file). And in this class I need to make a field with a string data type. But when trying to create it, an error appears: “String” identifier “is not defined”, although I used the #include in the shapehead. Also tried to prescribe the includ in the .cpp file itself, but still closes this error.


Answer 1, Authority 100%

Instead of

string name;

need to write

std :: string name;

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions