Please how string data type is declared in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please how string data type is declared in c++

Data type

30th Jul 2022, 5:33 PM
Yahaya Abdullahi
Yahaya Abdullahi - avatar
1 Answer
+ 5
In order to use the string data type, the C++ string header <string> must be included at the top of the program. Also, you’ll need to include using namespace std; to make the short name string visible instead of requiring the cumbersome std::string. (As a side note, std is a C++ namespace for many pieces of functionality that are provided in standard C++ libraries. For the purposes of this class, you won't need to otherwise know about namespaces.) Thus, you would have the following #include's in your program in order to use the string type. #include <string> using namespace std;
30th Jul 2022, 5:43 PM
Mihir Lalwani
Mihir Lalwani - avatar