Get lengh of a C++ string : string length « String « C++






Get lengh of a C++ string

  
#include <iostream>
#include <string>

using namespace std;
int main()
{
     string stringA = "C++";
     string stringB = "Is Cool";
     cout << "Length of stringA = " << stringA.length() << endl;
     cout << "Length of stringB = " << stringB.length() << endl;
     return 0;
}
  
    
  








Related examples in the same category