basic_string::size_type

Un tipo Integer senza segno che può rappresentare il numero di elementi e degli indici in una stringa.

typedef typename allocator_type::size_type size_type;

Note

Equivale a allocator_type::size_type.

Per tipo stringa, è equivalente a size_t.

Esempio

// basic_string_size_type.cpp
// compile with: /EHsc
#include <string>
#include <iostream>

int main( ) 
{
   using namespace std;
   string str1 ( "Hello world" );

   basic_string <char>::size_type sizeStr1, capStr1;
   sizeStr1 = str1.size (  );
   capStr1 = str1.capacity (  );

   cout << "The current size of string str1 is: " 
        << sizeStr1 << "." << endl;
   cout << "The capacity of string str1 is: " << capStr1 
         << "." << endl;
}
  
  

Requisiti

intestazione: <string>

Spazio dei nomi: deviazione standard

Vedere anche

Riferimenti

basic_string Class