1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <stdio.h> char buf[256]; main() { FILE * fd; fd = fopen("/etc/passwd", "r"); while(fgets(buf, sizeof(buf), fd) != NULL) { printf(">>%s", buf); } }