delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/01/22:14:53

Message-Id: <199707020124.JAA09958@mitswa.com.au>
Comments: Authenticated sender is <pwhitfie@[159.73.150.100]>
From: "Paul Whitfield" <pwhitfie AT mitswa DOT com DOT au>
To: djgpp AT delorie DOT com
Date: Wed, 2 Jul 1997 10:12:05 -480
Subject: Re: Directory Listing
Reply-to: paulw AT mitswa DOT com DOT au

Why bother posting code without checking it! The person who asked the 
questin is obviously a novice programmer - or newbie to djgpp 
otherwise they would not have posted such a simple request

Here is the code that works and does not have a void return type. 


#include <stdio.h>
#include <dir.h>

int main(int argc, char *argv[])
{
  struct ffblk ff;
  int done;

  done=findfirst(argv[1],&ff,0);
  while(!done)
  {
       printf("%s\n",ff.ff_name);
       done=findnext(&ff);
  }
  return 0;
}
 
------------------------------------------------------------
Paul Whitfield                !
Senior Software Engineer      ! No Amusing Quote currently 
Mits WA Limited               ! available ...
Email: paulw AT mitswa DOT com DOT au    !

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019