delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/20/04:17:23

Date: Mon, 20 Oct 1997 09:05:44 +0200 (MET DST)
From: Miguel Murillo <mmurillo AT ideafix DOT litec DOT csic DOT es>
To: Erik Max Francis <max AT alcyone DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: A really simple program
In-Reply-To: <3442DE31.5A9DD845@alcyone.com>
Message-ID: <Pine.LNX.3.95.971020090455.27070A-100000@ideafix.litec.csic.es>
MIME-Version: 1.0

A very bad program:
-------------------

#include <stdio.h>
#include <stdlib.h>

int main()
{  
   FILE *fd;
   int i = 0;
   char cad[100];
   system("ls *.c > __tmp");
   /* UNIX :  system("ls *.c > __tmp");*/
   fd =fopen("__tmp","r+");
 
   fscanf(fd,"%s",&cad);
   while(!feof(fd))
   {  
      printf("file(%d) = %s\n",i,cad);
      i++;
      fscanf(fd,"%s",&cad);
   }
} 

Good Luck!
______________________________________________________________________________
     |\\/\/\/\/\/|   _____________  |
     |           |  /             \ | Miguel Murillo
     |           |  | Elvis is    | | mmurillo AT ideafix DOT cps DOT unizar DOT es
     |  __   __  |  |   dead !    | | Voice: +34-976-761000 ext. 5052
     | |  | |  | |  |             | | Fax: +34-976-761882
    C\ |0 | |0 | /O |       bart. | |
      | "" _ "" |   \_ __________/  | Laboratorio de Investigacion en
      |         |    //             | TEcnologias de la Combustion (CSIC)
       \'-----'/   --'              |
   _____/-----\_____                | Computer:bart.cps.unizar.es
  /  |           |  \               |          (155.210.32.114)
____________________________________|_________________________________________
                 Linux: The choice of a GNU generation
         "My opinions are my own, and I've get *lots* of them!" 


- Raw text -


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