Hola, extraído de la ayuda de C++ Builder:
Código:
...
In C++, sizeof(classtype), where classtype is derived from some base class, returns the size of the object (remember, this includes the size of the base class).
...
AnsiString está implementada como una clase, entonces sizeof(coordenada_x) va a devolver el tamaño en bytes del objeto, no de su contenido.
Código:
Length:
Returns the length of the AnsiString.
int __fastcall Length() const;
Description
Length returns the number of bytes in this AnsiString.
Luego entonces, para saber el numero de bytes que necesitas pasarle como parámetro al método Write debes usar Length:
Código Delphi
[-]
...
rotar->Write(coordenada_x.data(), coordenada_x.Length());