: Hello everybody,
: can anyone help me? :S
: how can I get only one character from
: WCHAR *str = L"string";
: for example only "r", when I'm typing this
: it gets "ring" and not "r"
: please help me ...
Since message box function takes a string as parameter - you need to CREATE a second string with only one character - one you need. Also, character indexes begin with 0, so 'r' will be addressed as str and not str.
WCHAR *str = L"string";
WCHAR buf ; // New string with room for ONLY one character
buf  = str ; // Move 'r' as first character of new string
buf  = 0; // Terminate new string with null as C lang. needs
MessageBox (0, buf, 0, 0); // Now you will see only one character