const???
程序代码:
void add(const Account* acc) { // 创建一个对象 Account* pnew = (Account*)malloc(sizeof(Account)); *pnew = *acc; // 把新节点添加到链表中 pnew->next = m_head.next; m_head.next = pnew; }
void add 函数 形参为什么加const???
void add(const Account* acc) { // 创建一个对象 Account* pnew = (Account*)malloc(sizeof(Account)); *pnew = *acc; // 把新节点添加到链表中 pnew->next = m_head.next; m_head.next = pnew; }