Complete the code to declare a C++ string variable named 'name'.
std::[1] name = "Alice";
In C++, std::string is used to declare string variables.
Complete the code to get the length of a C++ string 'text'.
int length = text.[1]();The length() method returns the number of characters in a C++ string.
Fix the error in the code to concatenate two C++ strings 'a' and 'b'.
std::string result = a [1] b;In C++, the '+' operator concatenates two strings.
Fill both blanks to create a C++ string from a C-style string 'charArray'.
std::string str([1]); // convert from [2]
To create a std::string from a C-style string, pass the char array variable.
Fill all three blanks to check if a C++ string 's' is empty.
if (s.[1]() [2] 0) { std::cout << "String is [3]" << std::endl; }
empty() method incorrectly in condition.Use length() to get string size and compare with == zero. If true, print "String is empty".
