CString::operator [ ]

This overloaded subscript ([]) operator retrieves a single character specified by the zero-based index in nIndex. This operator is a convenient substitute for the GetAt method.

You can use the subscript ([]) operator to get the value of a character in a CString, but you cannot use it to change the value of a character in a CString.

At a Glance

Header file: Afx.h
Platforms: H/PC 2.0, Palm-size PC, H/PC Pro
Windows CE versions: 1.0 and later
Complete documentation: Visual C++ documentation

Syntax

TCHAR operator []( int nIndex ) const;

See Also

CString::GetAt, CString::SetAt