谁能帮我看看这个pro*c的程序芝诺悖论错在哪里里

谁能帮我看看这个程序错在哪了?? 谢谢_百度知道
谁能帮我看看这个程序错在哪了?? 谢谢
#include &iostream.h&class circle//定义circle类{ protected://声明其数据私 public://声明其数据公
void print()//定义输函数
cout&&&半径:&&&r&&
circle(double r1=0):r(r1)
double getr()//获取圆半径
virtual double volume()//定义体积函数
return(0);
}};class sphere:public circle{ public: sphere(double r1=0):circle(r1) {} void print() {
circle::print(); } virtual double volume() {
double R=getr();
return((3.14*R*R*R)*3/4); }};class cylinder:public circle{public: cyclinder(double r1=0,double h1=0):circle(r1) {
h=h1; } void print() {
circle::print();
cout&&&圆柱高:&&&h&& }
virtual double volume() {
double R=getr();
return(3.14*R*R*h); }};void main(){ circle *p;//抽象类指针指向其派类
sphere s(2); cylinder c(2,3); p=&c;//抽象类指针指向圆柱体类 p-&print(); cout&&&圆柱体体积=&&&p-&volume()&& p=&s;//抽象类指针指向球类 p-&print(); cout&&&球体积=&&&p-&volume()&&}D:\vc\Cpp1.cpp(43) : error C2065: 'r1' : undeclared identifierD:\vc\Cpp1.cpp(44) : error C2057: expected constant expressionD:\vc\Cpp1.cpp(44) : error C2656: 'cyclinder' : function not allowed as a bit fieldD:\vc\Cpp1.cpp(46) : warning C4183: 'cyclinder': member function definition looks like a ctor, but name does not match enclosing classD:\vc\Cpp1.cpp(65) : error C2661: 'cylinder::cylinder' : no overloaded function takes 2 parameters执行 cl.exe 错.Cpp1.obj - 1 error(s), 0 warning(s)
提问者采纳
我试cylinder类:cyclinder(double r1=0,double h1=0):circle(r1)改cylinder(double r1=0,double h1=0):circle(r1)没错
提问者评价
其他类似问题
为您推荐:
其他1条回答
语句结束 掉号另外 String【】 xx改掉 便区 args符合规范 听类名第字母要写 基本规范if(){}语句要注意 写:public class Test9 { public static void main(String[] args) { int x=1; while(x&6){ x++; if(x&=6){ System.out.println(&hello&); }}} }
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁谁能帮我看看这道C语言程序错在哪里?_百度知道
谁能帮我看看这道C语言程序错在哪里?
#include&stdio.h&int arrdel(int *,int,int);void arrout(int *,int);#define N 10main(){
int n=N,k,a[N]={12,36,72,95,3,15,8,45,25,33};
arrout(a,n);
printf(&Please input to delete the digits!\n&);
scanf(&%d&,k);
n=arrdel(a,n,k-1);
arrout(a,n);}void arrout(int w[],int m){
for(i=0;i&n;i++)
printf(&%4d&,w[i]);
printf(&/n&);}int arrdel(int w[],int n,int k){
for(i=k;i&n-1;i++)
w[i]=w[i+1];
scanf边少&问题
提问者采纳
主要换行符号写错\应该/注意#include&stdio.h&int arrdel(int *,int,int);void arrout(int *,int);#define N 10main(){
int n=N,k,a[N]={12,36,72,95,3,15,8,45,25,33};
arrout(a,n);
printf(&Please input to delete the digits!\n&);
scanf(&%d&,&k);
n=arrdel(a,n,k-1);
arrout(a,n);}void arrout(int w[],int m){
for(i=0;i&m;i++)
printf(&%4d&,w[i]);
printf(&\n&);//问题}int arrdel(int w[],int n,int k){
for(i=k;i&n-1;i++)
w[i]=w[i+1];
void arrout(int w[],int m)不行只能把m改成n为什么不能把n改成m呢?
这样也可以,但你之前已经定义了一个n了!这样会造成重复,你可以定义之前没定义的新名字,但不能定义重复。
来自团队:
其他类似问题
为您推荐:
c语言程序的相关知识
其他5条回答
arrout参数m函数n
改过来了,还是有错!
能给出调试错误么?arrdel里是n不是n-1
arrout参数是m,但你函数中却用成了n。
改过来了,但是还是有问题的
不会啊,我的怎么运行成功了呢?你的问题提示是什么?用的什么软件?
main函数用void,表示无返回值类型,再就是参数m,n的问题,还有最后的printf(&/n&),应该是&\n&
为什么只能把m改成n不能把n该成m呢?
就是在main函数前面加void嘛,直接写的函数默认返回参数类型是int,你也可以写成int main(),但是在函数的最后要加上return(0);
为什么只能把m改成n不能把n该成m呢?
好像都可以么。。。arrout函数定义的(int X)里面的只是形式参数,要么都改成m,要么都改成n,两者保持一致就可以勒
我认为也可以,可是,程序编译不过去,只有n才能编译过去!
啊??但是我的可以通过啊= = 。。。我用的VC++6.0.。。而且理论上讲应该没问题啊,就是把arrout函数改成下面这种样子的话:void arrout(int w[],int m){
for(i=0;i&m;i++)
printf(&%4d&,w[i]);
printf(&\n&);}
程序改完错误1)缺少&;2)循环条件为for(i=0;i&m;i++)&在VC++6.0下就可以正常运行了。&输入删除第几个元素就可以删除,比如我输入1,得到结果如下:&&结果是正确的。但我发现如果输入大于10的数据,最后一个数据也是被删除的。因为不管怎样n总是--的。但是如果对不存在的内存区做操作w[i]=w[i+1];VC++6.0居然没有报错,所以我想更严格来说是要对输入的数据做一个限制,防止做违法操作!&我不明白楼主的追问的意思,如果是初学者的话,联系我,咱们交流一下。一般用VC++6.0初学比较稳妥的。&program团队为您服务!希望能帮到您!
#include&stdio.h&int arrdel(int *,int,int);void arrout(int *,int);#define N 10main(){int n=N,k,a[N]={12,36,72,95,3,15,8,45,25,33};
arrout(a,n);
printf(&\nPlease input to delete the digits!\n&);
scanf(&%d&,&k);
n=arrdel(a,n,k-1);
arrout(a,n);}void arrout(int w[],int m){for(i=0;i&m;i++)printf(&%4d&,w[i]);
printf(&/n&);}int arrdel(int w[],int n,int k){for(i=k;i&n-1;i++)w[i]=w[i+1];
n--;}功能完成。
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁> 高手来 ,PRO*C编译遇到一个异常PCC-S-02201
高手来 ,PRO*C编译遇到一个异常PCC-S-02201
xmxuexm & &
发布时间: & &
浏览:114 & &
回复:3 & &
悬赏:0.0希赛币
高手来 ,PRO*C编译遇到一个错误PCC-S-02201,在线等系统:SunOS数据库:Oracle 9i出现很多PCC-S-02201,到晚上找了一下,有很多类似的问题,主要是1.修改$ORACLE_HOME/precomp/admin/pcscfg.cfg2.编译选项parse=none我试了都没解决问题,高手帮帮忙。我的pcscfg.cfg文件如下:sys_include=(/usr/include,/usr/include/sys,oracle/ora920/precomp/public,/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include)include=$(ORACLE_HOME)/precomp/publicinclude=$(ORACLE_HOME)/precomp/hdrsinclude=$(ORACLE_HOME)/rdbms/publicinclude=$(ORACLE_HOME)/rdbms/demoinclude=$(ORACLE_HOME)/network/includeinclude=$(ORACLE_HOME)/network/publicinclude=$(ORACLE_HOME)/plsql/publicltype=shortdefine=__x86_64__编译错误信息如下:Syntax error at line 69, column 2, file /usr/include/sys/uio.h:Error at line 69, column 2 in file /usr/include/sys/uio.h &
lloff_t _uio_
/* file offset */.1PCC-S-02201, Encountered the symbol &lloff_t& when expecting one of the following: &
} char, const, double, enum, float, int, long, ulong_varchar, &
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime, &
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber, &
OCIRaw, OCIString, short, signed, sql_context, sql_cursor, &
struct, union, unsigned, utext, uvarchar, varchar, void, &
volatile, a typedef name,The symbol &enum,& was substituted for &lloff_t& to continue.Syntax error at line 72, column 2, file /usr/include/sys/uio.h:Error at line 72, column 2 in file /usr/include/sys/uio.h &
lloff_t _uio_
/* u-limit (maximum byte offset) */.1PCC-S-02201, Encountered the symbol &lloff_t& when expecting one of the following: &
} char, const, double, enum, float, int, long, ulong_varchar, &
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime, &
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber, &
OCIRaw, OCIString, short, signed, sql_context, sql_cursor, &
struct, union, unsigned, utext, uvarchar, varchar, void, &
volatile, a typedef name,The symbol &enum,& was substituted for &lloff_t& to continue.Syntax error at line 52, column 2, file /usr/include/sys/socket_impl.h:Error at line 52, column 2 in file /usr/include/sys/socket_impl.h &
sa_family_t
/* address family */.1PCC-S-02201, Encountered the symbol &sa_family_t& when expecting one of the following: &
char, const, double, enum, float, int, long, ulong_varchar, &
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime, &
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber, &
OCIRaw, OCIString, short, signed, sql_context, sql_cursor, &
struct, union, unsigned, utext, uvarchar, varchar, void, &
volatile, a typedef name,The symbol &enum,& was substituted for &sa_family_t& to continue.
检查头文件目录是否就是期望的目录,Oracle缺省设置的目录有时候需要修改/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include是否包含编译器提供的头一般设置成如下所示的造型也就可以了sys_include=(/usr/include,/usr/include/sys,oracle/ora920/precomp/public,/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include)& ltype=short& define=__x86_64__&
xmy314159 & &
& & (0)(0)引用我感觉是lloff_t的类型没有定义,所以可能是在$ORACLE_HOME/precomp/admin/pcscfg.cfg 没有包括定义lloff_t需要的头文件的目录,或者定义这个类型需要某些宏,这些宏没有在$ORACLE_HOME/precomp/admin/pcscfg.cfg 中定义。我是根据我的经验猜的,不一定准确,仅供参考
xmyalec & &
& & (0)(0)引用先看下lloff_t的类型是定义在哪个头文件里面的,假设是a.hxmyalec & &
& & (0)(0)引用
本问题标题:
本问题地址:
温馨提示:本问答中心的任何言论仅代表发言者个人的观点,与希赛网立场无关。请对您的言论负责,遵守中华人民共和国有关法律、法规。如果您的言论违反希赛网问答中心的规则,将会被删除。
暂无合适的专家
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&【【这是一个程序吗??!!!!!!!大侠们帮我看看!~~~~~】_c语言吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:398,865贴子:
【【这是一个程序吗??!!!!!!!大侠们帮我看看!~~~~~】收藏
#define&HZ_LIB#include&&stdio.h&#include&&conio.h&#include&&dos.h&#include&&..\Course.h&#include&&..\Course.c&int&choice,&quit&=&0;char*&sMsg&=&&白&;char&cGvoid&interProcess(){;}void&userFace(){;}void&interface(){int&iX0,&iY0,&iX1,&iY1;char&cRchar&sChar[2];char&cLFILE*&int&i&=&0;clrscr();printf(&%20s***************************\n&,&&&);printf(&%20s//&//\n&,&&&);printf(&%20s//&Chinese&Character&Proc&Demo&//\n&,&&&);printf(&%20s//&//\n&,&&&);printf(&%20s//&1&&Read&One&Character&//\n&,&&&);printf(&%20s//&2&&Write&One&Character&to&Screen&//\n&,&&&);printf(&%20s//&//\n&,&&&);printf(&%20s////////////////////////////////////////////////\n&,&&&);printf(&please&input&your&choice(1--q):&);do{switch(choice){case&'1':&//显示单个汉字/*&用户使用ucdos字库作为矢量汉字的读取源。&读取到的汉字矢量数据将保存在全局数组变量iDot中,保存的顺序如下:(n1),0,X0,Y0,X1,Y1,X2,Y2,X3,Y3,……,X(n1),Y(n1),&(n2),0,X0,Y0,X1,Y1,……。其中n1,n2为每一笔划所需的坐标点数。*/cGet&=&getHZChar(&白&,&&../HZKSLKTJ&,&&../HZKSLT&);if&(cGet&&&0x0f)&printf(&Read&data&Failed!\n&);else&printf(&Read&data&successfully.\n&);getch();case&'2':&//对读取到的汉字进行操作/*&首先设置汉字信息的结构体,它主要包括以下几个内容:字的起始X坐标,起始Y坐标,宽度,高度,旋转角度和倾斜角度,即使对这些参数没有特殊要求,也需设置为一个合适的值。下述代码规定了汉字“北”的绘制参数:起始于坐标(50,&50),宽度/高度为40/40,字不产生旋转,也不产生倾斜。*/strMode.iX&=&50;strMode.iY&=&50;strMode.iWidth&=&40;strMode.iHeight&=&40;strMode.fRotate&=&0;strMode.fIncline&=&0;/*下面一行将在屏幕的(50,50)开始显示大小为40X40的汉字“北”;同时将&“白”字的坐标信息保存到output.txt中。*/cResult&=&procHZChar(0x03,&(cGet&&&0x10)&&&&4);if&(cResult)&printf(&Graphics&Failed!\n&);getch();closeGrp();void&Control&View:On&Timer(output.txt)&//读取output.txt信息来获取位置脉冲,从而使刻写机刻写出输入的文字。{Long&Pos&X,Pos&Y;Get_abs_pos(1,&PosX);//获取x轴位置脉冲Get_abs_pos(2,&PosX);//获取Y轴位置脉冲if(check_batch_done(&)==0){if((Direction=0&&Go&on=0){SSum++;if(Direction=0&&Rettlrn==0)SStim--:if(SSum&=0&&SSum&Sum)Send():&//继续发送控制代码}&我的这个程序实现的目的就是当你在电脑一个程序里输入一个中文字,比如王,然后雕刻机就要把输入的这个字在一个标牌上雕刻出来~其实实质就是“把文字转化成G代码”!如果哪位大虾能帮我改改或提些意见!!!谢谢!!!!
汗死,天书!!!!!!!
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或谁能帮我看看这个C语言程序哪里错了?_百度知道
谁能帮我看看这个C语言程序哪里错了?
#include&stdio.h&#include&ctype.h&#include&stdbool.h&#include&stdlib.h&#include&time.h&int main(void){& & char another_game = 'Y';& & bool correct =& & int counter = 0;& & int sequence_length = 0;& & time_t seed = 0;& & int number = 0;& && & time_t now = 0;& & int time_taken = 0;& & printf(&\nTo play Simple Simon, watch the screen for a sequence of digits.&);& & printf(&\nWatch carefully, as the digits are only displayed for a second! &);& & printf(&\nThe computer will remove them, and then prompt you to enter the same sequence.&);& & printf(&\nWhen you do, you must put spaces between the digits.&);& & printf(&\nGood luck!\nPress Enter To Play\n&);& & scanf(&%c&,&another_game);& & do& & {& & & &correct =& & & &counter = 0;& & & &sequence_length = 2;& & & &time_taken = clock();& & & &while(correct)& & & &{& & & & &sequence_length += counter++%3 == 0;& & & & &seed = time(NULL);& & & & &now = clock();& & & & &srand((unsigned int)seed);& & & & &for(i = 1; i &= sequence_ i++)& & & & & &printf(&%d&,rand() % 10);& & & & &for(; clock() - now & CLOCKS_PER_SEC;);& & & & & &printf(&\r&);& & & & &for(i = 1; i &= sequence_ i++)& & & & & &printf(& &);& & & & &if(counter == 1)& & & & & &printf(&\nNow you enter the sequence - don't forget the spaces\n&);& & & & &else& & & & & &printf(&\r&);& & & & &srand((unsigned int)seed);运行第二组数显示数消失直接显示数Do you want to play again(y/n)?哪错
我有更好的答案
发完整代码.段代码 图片算事啊,给调试
发不上去啊…超字数了…您能辛苦点帮我看看吗?
其他类似问题
为您推荐:
c语言程序的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 错版人民币错在哪里 的文章

 

随机推荐