use of string in c++ code example
Example 1: string in cpp
// Include the string library
#include <string>
// Create a string variable
string greeting = "Hello";
Example 2: c++ string
#include <string>
std::string myString = "Hello, World!";
// Include the string library
#include <string>
// Create a string variable
string greeting = "Hello";
#include <string>
std::string myString = "Hello, World!";