下列定义字符串语句中,哪个是错误的定义语句:
A.char x[10];x="program";
B.char *x;x="program";
C.char x[10]="program";
D.char *x="program";
A.char x[10];x="program";
B.char *x;x="program";
C.char x[10]="program";
D.char *x="program";
A、char s[]={ '1', '2', '3', '\0'};
B、char s[]={ "123"};
C、char s[3]={ '1', '2', '3'};
D、char s[4]={ '1', '2', '3'};
A、eval 函数的作用是将输入的字符串转为Python语句,并执行该语句
B、如果用户希望输入一个数字,并用程序对这个数字进行计算,可以采用 eval(input(<输入提示字符串>)) 组合
C、执行 eval("Hello") 和执行 eval(" 'Hello' ") 得到相同的结果
D、eval 函数的定义为:eval(source, globals=None, locals=None, /)
A.strcpy(s1,s2)
B.strcpy(s1,"ABCDE");
C.sl="ABCDE";
D.for(i=0;i<6;i++)sl[i]=s2[i]
清使用VC6或使用【答题】菜单打开考生文件夹projl下的工程projl,此工程中包含了类Pets(“宠物”) 和主函数main的定义。程序中位于每个“//ERROR****found ****”之后的一行语句有错误,请加以改 正。改正后程序的输出结果应为: Name:sonny Type:dog Name:John Type:dog Name:Danny Typc:cat Name:John Type:dog 注意:只修改每个“//ERROR ****found ****”下的那一行,不要改动程序中的其他内容。 include using namespace sm; enum Pets_type{d09,cat,bird,fish}; class Pets{ private: char *name; Pets_type type; public: Pets(const char *name=”sonny”,Pets_type type=dog); Pets&operator=(const Pets&s); ~Pets; void showeonst;}; Pets::Pets(eonst char$naIne,Pets_type type) //构造函数 { This ->name=new char[strlen(name)+1]; strcpy(this一>name,name); //ERROR *********found********* type=type; }{ Pets::~Pets//析构函数,释放name所指向的字符串 { //ERROR *********found********* name=’/0‘; } Pets&Pets::0perator=(const Pets&s){ if(&s==this)//确保不要向自身赋值 return *this; delete[]name; name=new char[strlen(S.name)+1];//ERROR *********found********* strcpy(this一>nmne,name); type=S.type: return *this;} void Pets::showconst cout$amp;
A、char str[7] = "FORTRAN";
B、char str[] = "FORTRAN";
C、char *str = "FORTRAN";
D、char str[] = {'F','O','R','T','R','A','N',0};
A、I love China!
B、China!
C、China!\0
D、什么都不输出
A、p->next=p2; p1->next=p;
B、p1=p;p=p2;
C、p=p2;p1->next=p;
D、p1=p;p->next=p2;
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!