Code Snippets C

#include
#include
int main(int argc, char *argv[])
{
FILE *filep;
char str[128];
if((filep = fopen(argv[ 1 ], "r"))==NULL) {
printf("Cannot open file.\n");
exit(1);
}
while(!feof(filep)) {
if(fgets(str, 126, filep))
printf("%s", str);
}
fclose(filep);
return 0;
}