Why am I getting a "Segmentation fault" error? I tried out gdb and determined that the fclose command is causing the error.
Thanks for help.Code:> cat fopen.c#include <stdio.h> int main() { FILE *fp; fp=fopen("bak/test.txt", "r"); printf("Hello, World!\n"); fclose(fp); return 0; } > gcc -g -o fopen fopen.c > ./fopen Hello, World! Segmentation fault