basic_string::const_pointer
Typ, który zawiera wskaźnik do const element w ciągu.
typedef typename allocator_type::const_pointer const_pointer;
Uwagi
Typ to synonim allocator_type::const_pointer.
Dla typu string, jest równoważne z char*.
Wskaźniki, które są zadeklarowane const musi być zainicjowany, gdy są one zgłoszone.Wskaźniki Const zawsze wskaż tej samej lokalizacji pamięci i mogą wskazywać na stałe lub nonconstant dane.
Przykład
// basic_string_const_ptr.cpp
// compile with: /EHsc
#include <string>
#include <iostream>
int main( )
{
using namespace std;
basic_string<char>::const_pointer pstr1a = "In Here";
const char *cstr1c = "Out There";
cout << "The string pstr1a is: " << pstr1a << "." << endl;
cout << "The C-string cstr1c is: " << cstr1c << "." << endl;
}
Wymagania
Nagłówek: <string>
Obszar nazw: std