Menu

ffblk structure unssported

2005-05-21
2012-09-26
  • Nopcea Francisc

    Nopcea Francisc - 2005-05-21

    this is the source code:

    include <stdio.h>

    include <dir.h>

    include <stdlib.h>

    include <conio.h>

    int main(void)
    {
    struct ffblk ffblk;
    int done;
    printf("Directory listing of .\n");
    done = findfirst("c:/",&ffblk,0);
    while (!done)
    {
    printf(" %s\n", ffblk.ff_name);
    done = findnext(&ffblk);
    }

    return 0;
    }

    the error i get is: the aggregate ffblk ffblk has incomplete type and cannot be defined.
    I don't know what it means... can anybody help me!

     
    • Anonymous

      Anonymous - 2005-05-21

      findfirst and findnext are not standard functions and as such you have to check the implementation specific to your library (in this case MSVCRT.DLL). It appears that you are applying a different implementation of these functions.

      The Microsoft versions are described here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/crt__find.2c._wfind_functions.asp

      The following works as you expect:

      include <stdio.h>

      include <stdlib.h>

      include <io.h>

      int main(void)
      {
      struct _finddata_t fileinfo ;
      long findhandle ;
      int finderror ;

      printf(&quot;Directory listing of *.*\n&quot;);
      
      findhandle = _findfirst(&quot;c:/*.*&quot;, &amp;fileinfo ) ; 
      if( findhandle != -1 ) 
      {
          do
          { 
              printf(&quot;%s\n&quot;, fileinfo.name); 
              finderror = _findnext( findhandle, &amp;fileinfo ) ; 
          } 
          while( finderror == 0 ) ;
      }
      
      (void)_findclose( findhandle ) ;
      
      system( &quot;pause&quot; ) ;
      
      return 0;
      

      }

      Clifford

       
    • Nopcea Francisc

      Nopcea Francisc - 2005-05-22

      thank you very much!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.