Fich: crear y cerrar

09 crear y cerrar.html
#include <stdio.h>
#include <stdlib.h>

FILE *fd1, *fd2;

int main(){
	
	fd1 = fopen("C:\\Users\\crear1.txt","wt");
	fd1 = fopen("C:\\Users\\crear2.txt","wt");
	
	if(fd1 == NULL || fd2 == NULL){
		printf("No se pudieron crear los archivos.\n");
	}
	else{
		printf("Archivos creados exitosamente\n");
	}
	
	fclose(fd1);
	fclose(fd2);	
	
	system("pause");
	return 0;
}

No hay comentarios:

Publicar un comentario