现在要从一个文件中读取数据,该文件的内容是调用C的函数
fwrite(dd.s, 16, 1, fp);
fwrite(&(dd.a), 4, 1, fp);
fwrite(&(dd.b), 4, 1, fp);
写入的,其中dd 为结构
struct {
   char   s[16];
   int     a;
   int     b;
} dd;  
假如现在一共写入了3个结构,怎样在delphi里将文件的数据读出并显示?

解决方案 »

  1.   

    什么格式的文件,如果是txt文件就用系统的txtfile来读就好了
      

  2.   

    现在要从一个文件中读取数据,该文件的内容是调用C的函数該文件至少是DLL文件才可以被調用.
      

  3.   

    struct {
       char   s[16];
       int     a;
       int     b;
    } dd;  
    可以使用type record
      

  4.   

    这样一个结构,在c中定义的
    struct  {
       u_int8_t   ch[16];
       u_int32_t   a;
       u_int32_t   b;
    }dd;
    把它写入文件,现在要在delphi中定义一个对应的record,
    怎样定义才合适?因为要对记录文件进行操作。
      

  5.   

    我明白了,你先定义Record数组,可以一次读出一个结构,然后把这个结构赋给定义的Record