C++,哪里出错了?出错提示:fatal error C1004: unexpected end of file found
发布网友
发布时间:2022-05-05 15:36
我来回答
共4个回答
懂视网
时间:2022-05-05 19:57
ORA-39125: Worker unexpected fatal error in KUPW$WORKER.PUT_DDLS while calling DBMS_METADATA.
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
ORA-39125: Worker unexpected fatal error in KUPW$WORKER.PUT_DDLS while calling DBMS_METADATA.CONVERT [TABLE_STATISTICS]
ORA-06502: PL/SQL: numeric or value error
LPX-00225: end-element tag "HIST_GRAM_LIST_ITEM" does not match start-element tag "EPVALUE"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.KUPW$WORKER", line 6377
----- PL/SQL Call Stack -----
object line object
handle number name
0x7c7cc190 15370 package body SYS.KUPW$WORKER
0x7c7cc190 6436 package body SYS.KUPW$WORKER
0x7c7cc190 12590 package body SYS.KUPW$WORKER
0x7c7cc190 3397 package body SYS.KUPW$WORKER
0x7c7cc190 7064 package body SYS.KUPW$WORKER
0x7c7cc190 1340 package body SYS.KUPW$WORKER
0x7fe82b28 2 anonymous block
Job "SYSTEM"."SYS_IMPORT_SCHEMA_02" stopped due to fatal error at 03:18:33
7908,1 底端
这个报错应该是可以通过导入参数exclude=statistics解决,不过统计信息不导入,需要重新收集!
,
热心网友
时间:2022-05-05 17:05
逻辑错误我不管,语法错误有三个,第零个是person类纯虚函数写错了,第一个是Boss类少了个反大括号,第二个是主函数里既然对指针取内容了,就不要用箭头访问,所以去掉前面的星号。我给你注释了。你贴的那个语法错误一看就知道是括号写错了,还有你的排版太难看了。
#include<iostream>
#include<cstring>
using namespace std;
class Person
{
public:
virtual void print() = 0;//纯虚函数 =0不能省略
virtual void input() = 0;
virtual void getpay()=0;
protected:
char name[20];
int number;
int age;
char sex;
float salary;
};
class Boss:public Person
{
public:
void input()
{
cout<<"请输入老板的姓名:";cin>>name;
cout<<"请输入编号:";cin>>number;
cout<<"请输入年龄:";cin>>age;
cout<<"请输入性别:";cin>>sex;
cout<<"请输入年薪:";cin>>salary;
};
virtual void print()
{
cout<<"姓名"<<"\t\t\t"<<"编号"<<"\t\t\t"<<"年龄"<<"\t\t\t"<<"性别"<<endl;
cout<<name<<"\t\t\t\t"<<number<<"\t\t\t"<<age<<"\t\t\t\t"<<sex<<endl;
};
void getpay()
{
cout<<"老板的工资为%f,salary"<<endl;
};
};//---------------少了个反括号
class Employee:public Person{
public:
void input()
{
cout<<"请输入雇员的姓名:";cin>>name;
cout<<"请输入编号:";cin>>number;
cout<<"请输入年龄:";cin>>age;
cout<<"请输入性别:";cin>>sex;
cout<<"请输入年薪:";cin>>salary;
};
void print()
{
cout<<"姓名"<<"\t\t\t"<<"编号"<<"\t\t\t"<<"年龄"<<"\t\t\t"<<"性别"<<endl;
cout<<name<<"\t\t\t\t"<<number<<"\t\t\t"<<age<<"\t\t\t\t"<<sex<<endl;
};
void getpay()
{
cout<<"雇员的工资为%f,salary"<<endl;
};
};
class Hourlyworker:public Person{
public:
void input()
{cout<<"请输入小时工的姓名:";cin>>name;
cout<<"请输入编号:";cin>>number;
cout<<"请输入年龄:";cin>>age;
cout<<"请输入性别:";cin>>sex;
cout<<"请输入年薪:";cin>>salary;
};
void print()
{cout<<"姓名"<<"\t\t\t"<<"编号"<<"\t\t\t"<<"年龄"<<"\t\t\t"<<"性别"<<endl;
cout<<name<<"\t\t\t\t"<<number<<"\t\t\t"<<age<<"\t\t\t\t"<<sex<<endl; };
void getpay(){
cout<<"小时工的工资为%f,salary"<<endl;};
};
class Commworker:public Person{
public:
void input()
{cout<<"请输入营销员的姓名:";cin>>name;
cout<<"请输入编号:";cin>>number;
cout<<"请输入年龄:";cin>>age;
cout<<"请输入性别:";cin>>sex;
cout<<"请输入年薪:";cin>>salary;
};
void print()
{cout<<"姓名"<<"\t\t\t"<<"编号"<<"\t\t\t"<<"年龄"<<"\t\t\t"<<"性别"<<endl;
cout<<name<<"\t\t\t\t"<<number<<"\t\t\t"<<age<<"\t\t\t\t"<<sex<<endl; };
void getpay(){
cout<<"营销员的工资为%f,salary"<<endl;};
};
int main(){
int n;
Person *p;
Boss b;
Employee e;
Hourlyworker h;
Commworker c;
cout<<"请选择职业类型:"<<endl;
cout<<"1.老板"<<" "<<"2.雇员"<<" "<<"3.小时工"<<" "<<"4.营销人员"<<endl;
cout<<"请输入职业类型对应的数字:";
cin>>n;
cout<<endl;
switch(n)
{
case 1:{
p=&b;//-------------------用指针前面就不要加*
p->input();//-------------------用指针前面就不要加*
p->print();//-------------------用指针前面就不要加*
p->getpay();//-------------------用指针前面就不要加*
}break;
case 2:{p=&e;//-------------------用指针前面就不要加*
p->input();//-------------------用指针前面就不要加*
p->print();//-------------------用指针前面就不要加*
p->getpay();}break;
case 3:{p=&h;//-------------------下同
p->input();
p->print();
p->getpay();}break;
case 4:{p=&c;
p->input();
p->print();
p->getpay();}break;
default:cout<<"你的输入有误!"<<endl;
}
return 0;
}
热心网友
时间:2022-05-05 18:23
你的老板类 class boss 少了个结束的大括号;
然后,你的main里面,使用了Person *p,下面在使用指针时不需要再加*了,直接使用
p = &b;
p->input();
这样的形式
热心网友
时间:2022-05-05 19:58
这种错误一般是因为大括号不匹配引起的,建议把格式排版一下,好好检查括号是否匹配。