#include <stdio.h>
#include <string.h>
int main(){
FILE *fichero;
char texto[1000];
fichero = fopen("C:\\Users\\agregartexto.txt","w");
printf("Introduzca el texto que quiere guardar en el archivo txt:\n");
fgets(texto,1000,stdin);
fputs(texto, fichero);
fclose(fichero);
system("pause");
return 0;
}
No hay comentarios:
Publicar un comentario