以下三条输出语句分别输出什么?char str1[] = "abc";char str2[] = "abc";const char str3[] = "abc";const char str4[] = "abc";const char* str5 = "abc";const char* str6 = "abc";cout boolalpha ( str1==str2 ) endl; // 输出什么?cout boolalpha ( str3==str4 ) endl; // 输出什么?cout boolalpha ( str5==str6 ) endl; // 输出什么?

以下三条输出语句分别输出什么?

char str1[] = "abc";

char str2[] = "abc";

const char str3[] = "abc";

const char str4[] = "abc";

const char* str5 = "abc";

const char* str6 = "abc";

cout << boolalpha << ( str1==str2 ) << endl; // 输出什么?

cout << boolalpha << ( str3==str4 ) << endl; // 输出什么?

cout << boolalpha << ( str5==str6 ) << endl; // 输出什么?


相关考题:

请补充函数fun(),该函数的功能是:把从主函数中输入的字符串str2接在字符串str1的后面。例如:str1=“How do”,str2=“you do?”,结果输出: How do you do?注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun的横线上填入所编写的若干表达式或语句。试题程序:include<stdio.h>include<conio.h>define N 40void fun(char*str1,char *str2){int i=0;char *pl=str1;char*p2=str2;while(【 】)i++;for(;【 】;i++)*(p1+i)=【 】;*(p1+i)='\0';}main(){char str1[N],str2[N);clrscr();printf("*****Input the string str1 Str2*****\n");printf("\nstr1:");gets(str1);printf("\nstr2:");gets(str2);printf("**The string str1 str2**\n");puts(str1);puts(str2);fun(str1,str2);printf("*****The new string *****\n");puts(str1);}

有如下程序: #inCludeiostream using namespaCe std; Class Book{ publiC: Book(Char*t=””){strCpy(title,t);} private: Char titlel40]; }; Class Novel:publiC Book{ publiC: Novel(Char*t=””):Book(t){} Char*Category( )Const{return”文学”;} }; int main( ){ Book * pb; pb=new Novel( ); Coutpb→Category( ); delete pb; return 0; } 若程序运行时输出结果是“文学”,则横线处缺失的语句是( )。A.Char*Category( );B.Char*Category( )Const;C.virtual Char*Category( )Const;D.virtual Char*Category( )Const=0;

有如下程序:#includeiostreamusing namespace std;class Book{public:Book(char*t=””){strcpy(title,t);}private:char title[40];};class Novel:public Book{public:Novel(char *t=””):Book(t){}char*Category()const{return”文学”;)};int main(){Book *pb;pb=new Novel();coutpb-Category();return 0;}若程序运行时输出结果是“文学”,则划线处缺失的语句是A.char*Category();B.char*Category()const;C.virtual char*Category()const;D.virtual char*Category()const=0;

以下程序includeincludemain(){char*p1="abc",*p2="ABC",str[50]="xyz", s 以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz", strcpy(str+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是______。A.xyzabcABCB.zabcABCC.yzabcABCD.xyabcABC

以下程序includeincludemain(){ char*pl="abc",*p2="ABC",str[50]="xyz";s 以下程序 #include<stdio.h> #include<string.h> main() { char*pl="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2.strcat(p1,p2)); printf("%s\n,str); } 的输出是______。A.xyzabcABCB.zabcABCC.yzabcABCD.xyabcABC

以下程序includeincludemain(){ char*p1="abc",*p2="ABC",str[50]="xyz";s 以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2,strcat(p1,p2)); printf("%ss\n",str); } 的输出是______。A.xyzabcABCB.zabcABCC.yzbcABCD.xyabcABC

以下程序 includeincludemain(){char*pl="abc",*p2="ABC",str[50]="xyz"; 以下程序 #include<stdio.h> #include<string.h> main() { char*pl="abc",*p2="ABC",str[50]="xyz"; strcpy(str+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是________。A.xyzabcABCB.zabcABCC.yzabcABCD.xyabcABC

以下程序 include include main() { char*p1="abc",*p2="ABC",str[50]="xy 以下程序 #include<stdio.h> #include<string.h> main() { char*p1="abc",*p2="ABC",str[50]="xyz"; strcpy(ar+2,strcat(p1,p2)); printf("%s\n",str); } 的输出是______。A.xyzabcABCB.zabeABCC.yzabcABCD.xyabcABC

18、以下程序的运行结果是: #include <stdio.h> char *fun(char *px,char *py); void main() { printf("%s%s\n",fun("abc","abcd"),fun("1234","123")); } char *fun(char *px,char *py) { return (*px > *py? px : py); }A.abcd1234B.abc1234C.abcd123D.abc123