The function FILE *tmpfile(void); creates a temporary binary file in update mode. It created a temporary file with unique file name. Temporary file gets deleted automatically when the stream associated with it is closed using fclose or when program terminates normally.
Function prototype of tmpfile
FILE *tmpfile(void);
- NONE
Return value of tmpfile
On success, this function returns a FILE pointer associated with the temporary file otherwise it returns NULL in case of failure.
C program using tmpfile function
The following program shows the use of tmpfile function to create a temporary file. This program performs standard input and output operations on temporary file like any other stream.
Stay Casino has quickly gained popularity among Australian online gamers, offering a thrilling gaming experience complemented by a diverse selection of games. With its user-friendly interface, players can easily navigate through a wide range of slots, table games, and live dealer options. This platform is designed to cater to both newcomers and seasoned players, providing endless entertainment.
One of the standout features of Stay Casino is its mobile compatibility. Whether you prefer playing on your smartphone or tablet, the casino ensures a seamless experience across all devices. Additionally, Stay Casino offers enticing bonuses and promotions, allowing players to enhance their gaming experience and increase their winning potential.
Customer support is another area where Stay Casino excels, providing a responsive service that ensures players receive assistance whenever needed. For those interested in learning more about Stay Casino’s offerings and promotions, you can visit their official site for detailed insights. Check it out here: https://thechurch.co.nz/. Overall, Stay Casino is a solid choice for Aussie players seeking a reliable and engaging online gaming destination.
#include <stdio.h> int main (){ int c, counter = 0; FILE *file; /* Create a temporary file */ file = tmpfile(); fputs("tmpfile C Standard Library function", file); /* Rewind file pointer */ rewind(file); while(!feof(file)){ c = fgetc(file); printf("%c", c); } fclose(file); return(0); }
Output
tmpfile C Standard Library function