#include <dir.h> #include <stdio.h> int main(void) { /* fname defines the template for the temporary file. */ char *fname = "TXXXXXX", *ptr; ptr = mktemp(fname); printf("%s\n",ptr); return 0; }