Gracias a Sdc me decidi a conocer un poco mas sobre C.... me e estado leyendo el manual que el mismo publico en este foro.. en dicho manual me encuentro como una especie de ejercicio que trata sobre un source que conteniene varios bugs.. Haber si ustedes pueden ayudarme... aqui estaa.....
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int g, char *f[])
{
FILE *arc; char buf[255],xyz[255],c; int jk=0,i,cl;
scanf("%s %s %s",buf,xyz,buf);
scanf("%s",buf);
scanf("%s",buf);
scanf("%s",buf);
scanf("%s",buf);
strcpy(buf,"C:/WEB");
strcat(buf,xyz);
arc = fopen(buf, "r");
if (arc == NULL){
printf(" ARCHIVO INVALIDO %s\n",buf);
return 0;
}
cl=0;
c = getc(arc); //bug BoF
while (c != EOF){
printf("%c",c); //bug FSoF
if (c=='\n'){
printf("\n");
c = getc(arc); //bug BoF
//printf("%d",cl);
cl=0;
}
else{
c = getc(arc); //bug BoF
cl++;
}
}
fclose(arc);
return 0;
}










Autor




En línea

thanks........!