a wide strtok problem

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
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));
	}
I just see that.
Thank's
Topic archived. No new replies allowed.