1.Variables should be initialized.
2.Before using pointer, should make sure that it is not null.
3.Under if section, should add {} to contain the code regardless of only one line. Because some compilers may miss the line under if section for special characters, then it will make the line excute all the time unless the if section is false.