Hi!
I've got an input wchar_t array in a callback function from expat:
void my_callback(con st wchar_t* data);
Additionally, I got a second function that I need to call within my
callback with:
void my_call_to(cons t wchar_t** arr);
Now the issue I got is that I am in the need to split of the <data>
array in two or max. three tokens, delimited wiht a | char. Then I
need to push it into a local array like
const wchar_t* arr[3] = {0,0,0};
and then put this array over to the my_call_to function so that it can
use it. I want to use chars on the heap so that they'll get
automatically destroyed after the function has left without taking
care on memory management. Now my issue is that strtok requires a non-
const char parameter to split from which I can't give. The next issue
is that I am uncertain how to fill in my const array wiht const
wchar_t values that get automatically freed up when leaving my
callback function? with strcpy and such things I'd require to create
new char arrays which I must delete by using delete[].
What I've been trying to do is to use std::wstring and its find() &
substr() functionality but i've discovered that I've got a speed loss
of ~ 30-40% (doing this for 10mio times) by using std::wstring so I
was thinking on trying out to use const wchar_t* arrays instead but I
am uncertain how to archieve my goal.
Can anyone help? Btw sorry for the possible dumb description but I am
doing a bit hard describing such things in here yet I hope it was
understandable so far.
Thanks + Regards
Alex