G
Guest
How can I copy 5 bytes from the middle of one array to another in Managed C++?
The following code segment causes the compilation errors below:
unsigned char cResult __gc[] = new unsigned char __gc[256];
unsigned char cBuf __gc[] = new unsigned char __gc[256];
....
strncpy(cBuf, (cResult + 10), 5);
***********************************************
error C2690: '+' : cannot perform pointer arithmetic on a __gc array
error C2664: 'strncpy' : cannot convert parameter 1 from 'unsigned char
__gc[]' to 'char *'
Can only convert a __gc array to or from Object * or Array *
***********************************************
Can anyone clarify this situation, please.
The following code segment causes the compilation errors below:
unsigned char cResult __gc[] = new unsigned char __gc[256];
unsigned char cBuf __gc[] = new unsigned char __gc[256];
....
strncpy(cBuf, (cResult + 10), 5);
***********************************************
error C2690: '+' : cannot perform pointer arithmetic on a __gc array
error C2664: 'strncpy' : cannot convert parameter 1 from 'unsigned char
__gc[]' to 'char *'
Can only convert a __gc array to or from Object * or Array *
***********************************************
Can anyone clarify this situation, please.