c语言代码如下:

_AttachmentSeq* att_;
……
for(i=0;i<att_->Count;i++)
{
printf("Filename:%s\n",att_->AttachmentS[i].attachinfo.Filename);
printf("Title:%s\n",att_->AttachmentS[i].attachinfo.Title);
}
……类型定义如下:
typedef struct
{
int Count;
_Attachment* AttachmentS;
}_AttachmentSeq;typedef struct//附件
{
_BinaryStream body; //文件体
_AttachInfo attachinfo; //压缩标志
}_Attachment;用pascal定义类型如下:
  _Attachment= record    //附件
    body: _BinaryStream;
    attachinfo: _AttachInfo
  end;
  _PAttachment = ^_Attachment;  _AttachmentSeq= record
    Count: Integer;
    Attachments: _PAttachment;
  end;
  _PAttachmentSeq = ^_AttachmentSeq;最上面那段代码怎么实现?
c里面用数组方式来访问指针,delphi应该怎么实现?

解决方案 »

  1.   

    printf是控制台程序中的,用Delphi的控制台程序中的WriteLn或Write代替
      

  2.   

    这些代码都是比较简单的吧, 哪行不懂?for(i=0;i<att_->Count;i++)
    {
    printf("Filename:%s\n",att_->AttachmentS[i].attachinfo.Filename);
    printf("Title:%s\n",att_->AttachmentS[i].attachinfo.Title);
    }
    var
      I: integer;
      S: string;
    begin
      for I := 0 to Att_^.Count do begin
         S := format('Filename:%s', [att_^.Attachments[I].AcctachInfo.FileName]);
         WriteLn(S);
         S := format('Tile:%s', [att_^.Attachments[I].attachInfo.Title]);
         WriteLn(S);
      end;
    end;