ungetc

tmpnam

#include <stdio.h>char *tmpnam(char *name);

The tmpnam( ) function generates a unique filename and stores it in the array pointed to by name. This array must be at least L_tmpnam characters long. (L_tmpnam is defined in <stdio.h>.) The main purpose of tmpnam( ) is to generate a temporary filename that is different from any other file in the current disk directory.

The function can be called up to TMP_MAX times. TMP_MAX is defined in <stdio.h>, and it will be at least 25. Each time tmpnam( ) is called, it will generate a new temporary filename.

A pointer to name is returned on success; otherwise, a null pointer is returned. If name is null, then the temporary filename is held in a static array owned by tmpnam( ) and a pointer to this array is returned. This array will be overwritten by a subsequent call.

A related function is tmpfile( ).




C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net