tmpnam
De cppreference.com.
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Défini dans l'entête <stdio.h>
|
||
| char *tmpnam( char *filename ); |
||
Crée un nom de fichier unique et le stocke dans la chaîne de caractères pointée par
filename. La fonction est capable de générer jusqu'à TMP_MAX des noms de fichiers uniques, mais tout ou partie d'entre eux peut être utilisé dans le système de fichiers et donc pas les valeurs de retour appropriés . Original:
Creates an unique filename and stores it in character string pointed to by
filename. The function is capable of generating up to TMP_MAX of unique filenames, but some or all of them may be in use in the filesystem and thus not suitable return values. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Sommaire |
[modifier] Paramètres
| filename | - | le pointeur de chaîne de caractères à utiliser comme un tampon de résultat. Si
NULL est passé, un pointeur vers une mémoire tampon interne statique est retourné .Original: pointer to the character string to be used as a result buffer. If NULL is passed, a pointer to an internal static buffer is returned.The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifier] Retourne la valeur
filename si filename n'était pas NULL. Sinon, un pointeur vers un tampon interne statique est renvoyé. Si aucun fichier approprié peut être générée, est renvoyé NULL .Original:
filename if filename was not NULL. Otherwise a pointer to an internal static buffer is returned. If no suitable filename can be generated, NULL is returned.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifier] Exemple
#include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <stdbool.h> int main(int argc, char *argv[]) { printf("Welcome to %s\n", argv[0]); printf("Called with %u arguments\n", argc - 1); char buffer[L_tmpnam] = {'\0'}; tmpnam(buffer); printf(buffer); printf("\n"); printf("Goodbye!\n"); exit(EXIT_SUCCESS); }
Résultat :
Welcome to ./main_release Called with 0 arguments /tmp/file6HADua Goodbye!
[modifier] Voir aussi
| renvoie un pointeur vers un fichier temporaire Original: returns a pointer to a temporary file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
| C++ documentation for tmpnam
| |