C程序例子:
char buf[512];
int itemp=1000;
memset(buf,'\0',512);
memcpy(buf,&itemp,2);delphi中怎么写?

解决方案 »

  1.   

    VOID FillMemory (PVOID Destination,DWORD Length,BYTE Fill)
    VOID CopyMemory (PVOID Destination, CONST VOID * Source,DWORD Length)
      

  2.   

    fillmemory(PVOID Destination,DWORD Length,BYTE Fill)
    VOID CopyMemory (PVOID Destination, CONST VOID * Source,DWORD Length)
      

  3.   

    同意楼上

    Move
    MoveMemory
    ZeroMemory
      

  4.   

    char buf[512];
    var buf:array[0..511] of char;
        itemp:integer;
    begin
    itemp=1000;
    Fillchar(@buf[1],'\0',512);
    CopyMemory(@buf[1],@itemp,2);
    end;Fillchar(@buf[1],'\0',512);
    这样类型的可以改为 ZeroMemory(@buf[1],512);
      

  5.   

    char buf[512];
    var buf:array[0..511] of char;
        itemp:integer;
    begin
    itemp=1000;
    Fillchar(@buf[1],'\0',512);
    CopyMemory(@buf[1],@itemp,2);
    end;Fillchar(@buf[1],'\0',512);
    这样类型的可以改为 ZeroMemory(@buf[1],512);
      

  6.   

    还有一个
    procedure Move(const Source; var Dest; Count: Integer);
    Move copies Count bytes from Source to Dest. No range checking is performed. Move compensates for overlaps between the source and destination blocks. Whenever possible, use SizeOf to determine the count.