help me with C languaje please, re: files.
Pablo Mora
fbsd.hackers at gmail.com
Sun Jun 5 05:35:22 GMT 2005
#include <stdio.h>
#include <stdlib.h>
int main(void) {
FILE *p_to_f;
char buf[1024];
int i, j = 0;
p_to_f = fopen("test","r");
if(p_to_f == NULL) {
perror("fopen");
exit(EXIT_FAILURE);
}
for(i = 0; i < 4 && !feof(p_to_f); i++) {
fgets(buf,1024,p_to_f);
printf("%s", buf);
}
fclose(p_to_f);
return 0;
}
I expect that be well what I did. Thanks Victor.
PD Corrigeme Si hay algo malo. :D
--
Concepción, Chile.
More information about the freebsd-hackers
mailing list