title: Converting a text file into an array: segmentation fault error
body: <p>I am working on a problem in the C language where I have to read a file containing the weights of elephant seals, put the contents of the file into an array, and then use that array to find the average weight of the elephant seals. I'm using a version of VNC viewer with a GCC9 complier, a C/C++ Compile Run extension in VSCode, and a C/C++ IntelliSense, debugging, and code browsing extension in VSCode. When I try to run the code, I end up getting a segmentation fault error and I don't know how to fix it. Can someone help me?
  <a href="https://i.stack.imgur.com/QPWn6.jpg" rel="nofollow noreferrer">code</a>
  <a href="https://i.stack.imgur.com/TzzRC.jpg" rel="nofollow noreferrer">error</a></p>