On my recent project on data mining, I made a same mistake for many times. Hence, I write this article to remember my faults.
First, when I read a file, I always forget checking the last line. Sometimes the last line of the file is blank, but I always ignore this. Hence, when I process the reading data, some errors will happen.
Secondly, I always use the pointer and array wrongly because I cannot think about all the situations carefully, and everytime segmentation fault will happen.