w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Segmentation fault (core dump) in C?
char *buff = fgets(buff, 1024, file);
      ^^^          ^^^

You need to call fgets with memory that you have already allocated. Something like:

char buff[1024];
fgets(buff, sizeof buff, file);




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.