Hi, how are you?
I can't use JNI or JNA due to current circumstances
I'm transcribing the cpp code to java
Code is
typedef unsigned char BYTE;
char *Data1; BYTE *Data2; for(... memmove(&Data1[i * 2], &Data2[j], 160);
If it's organized like this, Data1 and Data2's data are given as much as the corresponding length I'm not sure what the indexes in & and [] mean here. Are you saying that you copy the value from Data2[j] by length = 160 with Data1[i*2] as the starting point? I don't know.
c++ java
This can be easily found in the references (#1, #2, and #3.
void* memmove(void* dest, const void* src, size_t count);
It looks like this and the action is to copy the count byte of src to the dest.
So in the example you're asking, you're copying 160 bytes from &Data2[j] to &Data1[i*2].
One thing to keep in mind when porting is that even if the dest and src overlap during the copy process, it should work properly.
© 2024 OneMinuteCode. All rights reserved.