Copy part of character array in wxString in C ++

I have a char array like this:

char aData[100];

How can I copy only a part of aData from index from index to wxString?

Is it possible to do with wxString as the destination and an array from char as the source, something like memcpy in C?

+3
source share
1 answer

You must do this using a constructor that takes the number of bytes.

wxString w(aData+from, to-from);

for an existing one w, you could say

w.assign(aData+from, to-from);

or you can use the iterator version:

w.assign(aData+from, aData+to);
+4
source

Source: https://habr.com/ru/post/1659159/


All Articles