注册 登录
编程论坛 C++教室

Q->next=NULL有什么用

lt2201004068 发布于 2012-03-20 17:59, 545 次点击
  void Creat2(node_account *&Q)
{
    Q=new node_account;
    if(!Q)
    {
        cout<<"分配失败"<<endl;
        outfile<<"分配失败"<<endl;
    }
    Q->next=NULL;
}
2 回复
#2
nicum2012-03-20 19:10
初始化,避免非法访问
#3
woshiyexinji2012-03-20 23:01
将 指针悬挂
1