Question: using code c im getting a segmentation fault (core dumped)error, How could i fix this. This code is to determine size of files in unix

#include int main() { FILE *fp; long int size = 0; }

using code c im getting a segmentation fault (core dumped)error, How could i fix this.

This code is to determine size of files in unix

#include int main() { FILE *fp; long int size = 0; } fp = fopen("temp, txt","r"); fseek(fp, 0, SEEK_END); size = ftell(fp); if(size != -1) else printf("File size is: %ld bytes", size); printf("Error "); return 0;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!