The main cause of the segmentation fault could be you are using a varibale without having been initiliazed or you are deleting a variable which is already deleted.