Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CString::GetAt
CString                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  char GetAt( int nIndex ) const;
 
  Parameter   Description
 
  <nIndex>    Zero-based index of the character in the CString object. The
              <nIndex> parameter must be greater than or equal to 0 and
              less than GetLength. The Debug version of the Microsoft
              Foundation Class Library validates the bounds of <nIndex>;
              the Release version will not.
 
  Remarks
 
  You can think of a CString object as an array of characters. The GetAt
  member function returns a single character specified by an index number.
  The overloaded subscript ([]) operator is a convenient alias for GetAt.
 
  Return Value
 
  A char containing the character at the specified position in the
  string.
 
  Example
 
  CString s( "abcdef" );
  ASSERT( s.GetAt(2) == 'c' );
 
 
  See Also
 
  CString::SetAt, CString::GetLength, CString::operator []
 
 
                                     -♦-