Mail Archives: djgpp/1997/09/16/04:14:59
On 16 Sep 1997, David Lenk wrote:
..
> anyways, I need a small program that will make a random 8.3 format text
> file (8.3 refers to the dos standard file length). The name generated
> would then have to be stored in a variable so that it could be used in a
> 'fprintf' command. I know how to write the file using fprintf but I have
> no ideal of how to generate the random name. I have tried to make the
> filename a random number but the program crashes with a GPF, and during
> compilation i get pointer errors.
use the tmpnam() function:
#include <stdio.h>
char *tmpnam (char *s)
which is designed exactly to produce a random filename.
-------------------------------------------------------------------
Orlando Alcantara Andico
WWW: http://www2.mozcom.com/~orly/ Email: orly AT mozcom DOT com
ICBM: 14 30 00 N 120 59 00 E POTS: (+632) 932-2385
- Raw text -