Advertisement
link186fr

Abrir Archivo en Linux

Feb 21st, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     FILE *fp;
  7.     char nombre[64];
  8.  
  9.     printf("Introduce el nombre del archivo mas su terminacion:\n");
  10.     gets(nombre);
  11.  
  12.  
  13.     if((fp=fopen(nombre,"r"))==NULL)
  14.     {
  15.      printf("No se puede abrir el archivo\n");
  16.      exit(1);
  17.     }
  18.     fclose(fp);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement