a wide strtok problem
Apr 2, 2009 at 5:13pm UTC
Hello all
In a while loop i must extract from str1 the πρν, then ζη, then μν.
The keys define the sequence of delimeters.
wcspbrk gives -ζη+μν , but not πρν that i whant. Any function for this?
1 2 3
wchar_t *str1(L"πρν-ζη+μν" );
wchar_t * keys ( L"+-" );
wchar_t *st=wcspbrk(str1,keys);
Thank's
Jim
Last edited on Apr 2, 2009 at 6:42pm UTC
Apr 3, 2009 at 7:59am UTC
Use strtok/wcstok. It writes into the buffer and is non-reentrant, but it does what you want.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
const wchar_t * src = L"πρν-ζη+μν" ;
const wchar_t * keys = L"+-" ;
wchar_t * p = 0;
wchar_t str[32];
wcscpy(str, src);
if (p = wcstok(str, keys))
{
do
{
}
while (p = wcstok(NULL, keys));
}
Apr 6, 2009 at 8:28am UTC
I just see that.
Thank's
Topic archived. No new replies allowed.