[Solved] c++ fgets Segmentation fault (core dumped)
It turns out that fd/fopen was not getting initialized on line 396 The modified code below allowed my program to run: Here is the code: 393: FILE *fd; 394: char fd_name[512]; 395: strcpy(fd_name,npb_list[freq][app][thread].file_name); 396: fd = fopen( fd_name, “r”); // <<- change made to this line 397: cout << “fd_name = ” << fd_name << … Read more