tmpnam
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
| Defined in header <stdio.h>
|
||
| char *tmpnam( char *filename ); |
||
Crea un nome di file univoco e lo memorizza nella stringa di caratteri puntato da
filename. La funzione è in grado di generare fino a TMP_MAX di nomi di file unici, ma alcuni o tutti loro potrebbe essere in uso nel file system e quindi non adatti valori di ritorno. 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.
Indice |
[modifica] Parametri
| filename | - | puntatore alla stringa di caratteri da utilizzare come buffer risultato. Se
NULL è passato, un puntatore a un buffer interno statico viene restituito .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. |
[modifica] Valore di ritorno
filename filename se non fosse NULL. In caso contrario, un puntatore a un buffer interno statico viene restituito. Se non filename adatto può essere generato, viene restituito 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.
[modifica] Esempio
#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); }
Output:
Welcome to ./main_release Called with 0 arguments /tmp/file6HADua Goodbye!
[modifica] Vedi anche
| restituisce un puntatore a un file temporaneo 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. (funzione) | |
| C++ documentation for tmpnam
|

