#include <stdio.h>
  main (int argc, char *argv[]) {
    FILE* file;
    char filename[] = "file.txt";
    char  buf[128];
	int i = 0;

    printf("File: %s\n", filename);


  /* open the file */
  file = fopen(filename, "r");
  if (!file) {
    fprintf(stderr, "open failed: can't open file \"%s\".\n",
	    filename);
    exit(1);
  }


/*  while(fscanf(file, "%s", buf) != EOF) {
    printf("Word %i: %s\n", ++i, buf);
  }
*/

  while(fgets(buf, 256, file) != NULL) {
    printf("Line %i: %s", ++i, buf);
  }
  }
