update
This commit is contained in:
16
DEV.1.1/Fichiers/ecriture-fichier/fputs.c
Normal file
16
DEV.1.1/Fichiers/ecriture-fichier/fputs.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*fputs(<chaîne de caractère>, <fichier>) : écrit une chaîne de caractère*/
|
||||
int main(void){
|
||||
FILE *fic = fopen("text.txt", "w");
|
||||
char mot[]="Bonjour";
|
||||
|
||||
if(fic==NULL)
|
||||
{exit(1);}
|
||||
|
||||
fputs(mot,fic);
|
||||
|
||||
fclose(fic);
|
||||
|
||||
}
|
Reference in New Issue
Block a user