C++: size_type, string::lenth, size and capacity

Objectives :

  • Basic string: size_type return the length of the string
    basic_string <char>::size_type sizeStr1, capStr1, xchar;
  • Get string size and capacity
     sizeStr1 = str1.size ( );
    capStr1 = str1.capacity ( );
    xchar = str1.length();
  • File Name : size_t_size_type1.cpp
  • Code: size_t_size_type1.txt
 

Step: 1 Create a source file.

Step: 2 Edit and save Source file

Step: 3 Runtime Views:

Step: