type
  test: a;
  temp: PChar;
// initialize test and temp
CopyMemory(temp, @test, sizeof(a));

解决方案 »

  1.   

    type
      test: a;
      temp: PChar;
    // initialize test and temp
    CopyMemory(temp, @test, sizeof(a));
      

  2.   

    在record里面还有PChar类型的,我想只能一个一个元素的复制
      

  3.   

    用CopyMemory(temp, @test, sizeof(a));也可以一条一条的处理,
    不过在拷贝玩了一条后,下一条该怎么处理呢?如果就用这个函数的话。或者有没有更简单的字符串追加的函数?急急,在线等待
      

  4.   

    只要inc(temp,sizeof(a))
    即只要移动指针就可以了
      

  5.   

    StrCat   函数     将一字符串附加到另一字符串尾并返回合并的字符串 
    StrLCat  函数     将一字符串中的字符附加到另一字符串尾并返回合并的字符串这两个是否有用呢?我不会用啊。
      

  6.   

    我想能用一个函数解决的问题就不弄得那么麻烦。
    而我对delphi的内存操作函数一点都不明白啊。
      

  7.   

    StrCopy, StrCat ExampleThe following example uses an edit control, a label, and a button on a form. When the button is clicked, the label抯 caption and the edit control抯 text are combined in a buffer. Then the buffer is displayed in the label抯 caption.procedure TForm1.Button1Click(Sender: TObject);var
      Buffer: PChar;
    begin
      GetMem(Buffer,Length(Label1.Caption) + Length(Edit1.Text) + 1);
      StrCopy(Buffer, PChar(Label1.Caption));
      StrCat(Buffer, PChar(Edit1.Text));
      Label1.Caption := Buffer;
      Edit1.Clear;
      FreeMem(Buffer);
    end;