I wrote the code that using txt file, but error "0 [main] assignment4 16012 cygwin_exception::open_stackdumpfile: Dumping stack trace to assignment4.exe.stackdump" is only thing that printed to console. Here is my code.

#include <stdio.h>

int main() {
  FILE *fp;
  char buff[255];

   fp = fopen("moby_dick.txt", "r");

   printf("%c\n", fgetc(fp));

  fscanf(fp, "%s", buff);
  printf("1 : %s\n", buff );

  fgets(buff, 255, (FILE*)fp);
  printf("2: %s\n", buff );

  fgets(buff, 255, (FILE*)fp);
  printf("3: %s\n", buff );
  fclose(fp);

}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.