|Top Previous Next|
What is translated > Special assignments
In Delphi the contents of array variables of the same type can be assigned directly. In C++ the assignment has to be done via pointers to the first array element by means of the functions "strcpy" or "memcpy":
Assignments to character arrays is done with "strcpy".
chr10 : array[1..10] of char;
chr10 := 'abcdefghij';
char chr10[ 10/*# range 1..10*/ ];
strcpy( chr10, "abcdefghij" );
Assignments of other static arrays are done with "memcpy".
procedure test(xArr: TObjectArray);
arr := xArr;
void __fastcall test( const TObjectArray& xArr )
memcpy( arr, xArr, sizeof( TObjectArray ) );
This page belongs to the Delphi2Cpp Documentation
|Delphi2Cpp home Content|