程序运行时出错

[复制链接]
查看11 | 回复1 | 2011-2-19 05:41:38 | 显示全部楼层 |阅读模式
#include
#include
using namespace std;
typedef struct data ndt;
typedef struct data *p;
bool a;
struct data
{

int num;

string name;

int ch;

int en;

int ma;

struct data *up;

struct data *next;
};
p creat(int nu,string nam,int chs, int ens,int mas,p dt)
{

if (!a)

{

dt=(p)malloc(sizeof(ndt));

dt->num=nu;

dt->name=nam;

dt->ch=chs;

dt->en=ens;

dt->ma=mas;

dt->up=NULL;

dt->next=NULL;

a=true;

}

else

{

p newdt,temp;

temp=dt;

while(temp->next!=NULL)temp=temp->next;

newdt=(p)malloc(sizeof(ndt));

newdt->num=nu;

newdt->name=nam;

newdt->ch=chs;

newdt->en=ens;

newdt->ma=mas;

newdt->up=temp;

temp->next=newdt;

}

return dt;
}
p search(int num,p dt)
{

p temp;

temp=dt;

while(1)

{

if (temp->num==num) return temp;

if (temp->next!=NULL){temp=temp->next;} else {return NULL;}



}
}
void display(p dt)
{

coutnumnamechenmanext!=NULL)

{

tmp=tmp->next;

coutnumnamechenma>choose;

switch (choose)

{

case 1:

cout>nu;

tmp=search(nu,mydata);

if (tmp==NULL) {coutnumnamechenma>nu;

cout>nam;

cout>chs;

cout>ens;

cout>mas;

mydata=creat(nu,nam,chs,ens,mas,mydata);

break;

case 6:

ifesc=true;

break;

case 7:

display(mydata);

}
}
system("pause");

return 0;
}
每次在进行第三次添加数据时就会出错,想知道问题所在
本人菜鸟一只

回复

使用道具 举报

千问 | 2011-2-19 05:41:38 | 显示全部楼层
在防火墙的规则里会有这项记录的,找到这个规则,进行修改或者删除即可,也有可能是加到黑名单里了,如果这样,删除黑名单里的这个程序即可。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行