All pastes #190205 Raw Edit

Stuff

public text v1 · immutable
·published 2006-10-03 20:19 UTC
rendered paste body
#include <stdio.h>
#include <string.h>
 main (){

   char nombre[20];
   char calle[20];
   char ciudad;
   int cumpleanios;
   int telefono1;
   int telefono2;
   
   //Definimos el nombre interno del fichero
   FILE * fichero;
   // Abrimos el fichero en modo escritura (r) y nos aseguramos que esta
   if((fichero = fopen("prueba.txt", "r"))!=NULL)
     { 
       while (fscanf (fichero,  "%s  %s  %s %d %d %d", &nombre, &calle, &ciudad,&cumpleanios,&telefono1,&telefono2)!=EOF)
         printf ("\el nombre  %s que vive en  %s en la ciudad $s nacido en %d tiene un tlf de %d y otro de %d",nombre,calle,ciudad,cumpleanios,telefono1,telefono2);
         fclose (fichero);
   }else{
   	printf ("Error al leer fichero");
   }
   getchar();

}