however the default value of seq is not null, which will lead to segment fault if some one accidentally create a FastqReader class by FastqReader() and never use it to open any fast/q file at all, in the end,
before the end of main function, the destroyer of FastqReader() will try to destroy something that does not exists and lead to segmentation fault use code in https://github.com/walaj/SeqLib/blob/master/SeqLib/FastqReader.h/#L40
hello walaj the default FastqReader constructor will take some default value of fp and seq, while you did not define their default value there. fp: https://github.com/walaj/SeqLib/blob/master/SeqLib/FastqReader.h/#L52 seq: https://github.com/walaj/SeqLib/blob/master/SeqLib/FastqReader.h/#L53 FastqReader(): https://github.com/walaj/SeqLib/blob/master/SeqLib/FastqReader.h/#L22
however the default value of seq is not null, which will lead to segment fault if some one accidentally create a FastqReader class by FastqReader() and never use it to open any fast/q file at all, in the end, before the end of main function, the destroyer of FastqReader() will try to destroy something that does not exists and lead to segmentation fault use code in https://github.com/walaj/SeqLib/blob/master/SeqLib/FastqReader.h/#L40
My suggestion is to change FastqReader(): https://github.com/walaj/SeqLib/blob/master/SeqLib/FastqReader.h/#L22 into something like below: FastqReader(){ seq = NULL; }