Implement function of link list, but get compile error