saving . . . saved File Prgram execution fault has been deleted. File Prgram execution fault has been hidden .
File Prgram execution fault
Title
Question
After execution of this program error comes as "segmentation fault (core dumped)" . how to solve this

C-and-Cpp File-Handling-In-C 06-07 min 10-20 sec 29-02-20, 1:08 p.m. mmpatil

Answers:

This usually happens because you are accessing some memory which is invalid.
29-02-20, 2:49 p.m. bhaskar76
How to rectify and what to do? Please explain.
30-10-20, 6:34 p.m. bsscharan

Login to add comment



06-11-23, 7:30 p.m. umrao1008@gmail.com


Debugged the error with my son's guidance.
Error is not due to invalid memory, since this is not a lengthy code but a simple code.
Error lies in path.
In place of the path in both File.c or readfile.c, we should not type 'ttt' after Home (home/ttt/desktop......), as shown in the code files downloaded. 'ttt' is for the tutor who made the code file.
For us, it should be replaced as shown in our own system's path.
In terminal, we should type pwd and enter. It display our current working directory path. In that we should take what is displayed after home/.  
Same should be typed in place of 'ttt' in the code files. Rest all the code is OK.
For eg.: In my terminal, when I typed pwd, it displayed the path home/dell. 
So I replaced 'ttt' with dell in both the codes, saved and executed.
It worked at both places (writing file and reading file both).
07-11-23, 1:50 p.m. umrao1008@gmail.com


Log-in to answer to this question.