[Solved] Can code that doesn’t execute cause segmentation fault? [closed]
[ad_1] No, code which doesn’t execute can’t cause a segmentation fault. Some other code (executed before the code you have shown) will be the cause. The other code is exhibiting undefined behaviour (as per the meaning of “undefined” in the C++ standard), and overwriting some area of memory it shouldn’t. Removing the else block from … Read more