Segfault core dumped
-
Hello , i need help with a segfault error in this program .
line 56: 5252 Segmentation fault (core dumped)
Program is here : https://ghostbin.com/paste/j453x
-
This is not a Qt problem at all.
Anyway, the bug is in line 61
in = &inFile;
- you assign a variable created on a stack to variablein
. In the next line, theinFile
goes out of scope and is deleted. So when you try to accessin
later in the code, it segfaults. -
@sierdzio said in Segfault core dumped:
Anyway, the bug is in line 61 in = &inFile; - you assign a variable created on a stack to variable in. In the next line, the inFile goes out of scope and is deleted. So when you try to access in later in the code, it segfaults.
Thanks !! . I know it's not Qt problem but that's why i posted it in C++ section