A. 正确
B. 错误
[试题]为什么加不加string.h都行?我不管哪个程序运行,加不加#include<string.h>都正确运行啊,那什么时候才必须要加?
[单选题]有以下程序 #include 〈string.h〉 main ( ) { char p[]={'a','b ,'c'}, q[10]={'a','b','c'}; printf("%d %d/n",strlen(p),strlen(q)); } 以下叙述中正确的是A.在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3B.由于p数组中没有字符申结束符,长度不能确定;但q数组中字符串长度为3C.由于q数组中没有字符串结束符,长度不能确定:但p数组中字符串
[单选题]有以下程序#include <stdio.h>#include <string.h>void fun(char s[][10],int n){char t; int i,j;for(i=0;i<n-1;i++)for(j=i+1;j<n;j++)/*比较字符串的首字符大小 ,并交换字符串的首字符*/if(s[i][0]<s[j][0]) {t=s[i][0];s[i][0]=s[j][0];s[j][0]=t;}}main(){char ss[5][10
[单选题]有以下程序#include<stdio.h>#include<string.h>typedef struct {char name[9]; char sex; float score[2];}STU;STU f(STUA.{STU b={“Zhao”,’m’,85.0,90.0}; int I;strcpy(a.name,b.name);a.sex=b.sex;for(i=0;i<2;i++) a.score=b.score;return a;}main(){STU
[单选题]有下面程序段 #include"stdio.h" #include"string.h" main() { char a[3][20]={{"china"},{"isa"},{"bigcountry!"}}; chark[100]={0},*p=k; int i; for(i=0;i<3;i++) {p=strcat(p,a[i]);} i=strlen(p); printf("%d/n","i);} 则程序段的输出结果是A.18B.19C.20D.21
[判断题] printf函数是一个标准库函数,它的函数原型在头文件"string.h"中。A . 正确B . 错误
当执行下面的程序时,如果输入ABC,则输出结果是( )。 #include<stdio.h> #include<string.h> main() ch
[主观题]编写类 String 的构造函数、析构函数和赋值函数已知类 String的原型为:class String{public:String(const char *str = NULL); // 普通构造函数String(const String &other); // 拷贝构造函数~ String(void); // 析构函数String & perate =(const String &other); // 赋值函数private:char *m_data; // 用于保
[单选题]函数String(3,”str”)的功能是( )A.把数值型数据转换成字符串B.返回有3个字符串组成的字符串C.从字符串中第3个字符D.从字符串中第3个字符的位置开始取字符串
[单选题]函数String(3,”str”)的功能是()A . 把数值型数据转换成字符串B . 返回有3个字符串组成的字符串C . 从字符串中第3个字符D . 从字符串中第3个字符的位置开始取字符串