#include <iostream> #include <string> using namespace std; int main() { string city = "London"; cout << "Length: " << city.length() << "\n"; // 6 cout << "Size: " << city.size() << "\n"; // 6 return 0; }
Click Run to execute this code.