Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
| Unicode Tasks | Multibyte Character Set (MBCS) Tasks
Use the following tips:
Working with a bytewise index into a string presents problems similar to those posed by pointer manipulation. Consider this example, which scans a string for a backslash character:
while ( rgch[ i ] != '\\' ) i++;This may index a trail byte, not a lead byte, and thus it may not point to a character.
Use the _mbslen function to solve the preceding problem:
while ( rgch[ i ] != '\\' ) i += _mbslen( rgch + i );This correctly indexes to a lead byte, hence to a character. The _mbslen function determines the size of a character (one or two bytes).
See Also The Last Character in a String