char buf[1024];
FILE* p = fopen("text", "rt");

while (fgets(buf, sizeof(buf), p)) fputs(buf);

fclose(p);