I\'m new at programming so there are some basics and maybe common sense that I don\'t know. I have a question about how to use fgets right. Based on the explanation of fgets, it
fp = fopen("sample.txt", "r"); while (1) { if (fgets(line,150, fp) == NULL) break; i++; printf("%3d: %s", i, line); } printf("%d\n",i);