函数String(n, "str")的功能是______。A.把数值型数据转换为字符串B.返回由n个字符组成的字符串C.从字符串中取出n个字符D.从字符串中第n个字符的位置开始取子字符串

函数String(n, "str")的功能是______。

A.把数值型数据转换为字符串

B.返回由n个字符组成的字符串

C.从字符串中取出n个字符

D.从字符串中第n个字符的位置开始取子字符串


相关考题:

请编写一个函数int compare(char *s,char *t)), 该函数的功能是对两个字符串进行比较。当s所指字符串和t所指字符串相等时,返回值为0;当s所指字符串大于是t指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0。注意:部分源程序已存在文件PROC8.cpp中。文件PROC8.cpp的内容如下://PROC8.cppinclude <iostream>include <string>using namespace std;int compare(char *s,char *t){//* * * * * * * * *}int main (){char str1[100],str2[100];int result;cout<<"Input the first string\n";cin>>str1;cout<<"Input the second string\n";cin>>str2;result=compare(str1,str2);if (result==0)cout<<"string1=string2 ! \n";else if (result>0)cout<<"string1>string2 ! \n";elsecout<<"string1<string2 ! \n";return 0;}

函数String(n,"str")的功能是( )。A.把数值型数据转换为字符串B.返回由n个字符组成的字符串C.从字符串中取出n个字符D.从字符串中第n个字符的位置开始取子字符串

函数String(3,”str”)的功能是( )A.把数值型数据转换成字符串B.返回有3个字符串组成的字符串C.从字符串中第3个字符D.从字符串中第3个字符的位置开始取字符串

函数String(n,字符串)的功能是( )。A.把数值型数据转换为字符串B.返回由n个字符组成的字符串C.从字符串中取出n个字符D.从字符串中第n个字符的位置开始取子字符串

函数String(n,"str")的功能是A.把数值型数据转换为字符串B.返回由n个字符组成的字符串C.从字符串中取出n个字符D.从字符串中第n个字符的位置开始取子字符串

以下函数fun的功能是返回str所指字符串中以形参c中字符开头的后续字符串的首地址,例如,str所指字符串为Hello!,c中的字符为e,则函数返回字符串ello!的首地址。若str所指字符串为空或不包含c中的字符,则函数返回NULL,请填空。char *fun(char *str,char c){ int n=0; char *p=str; if(p!=NULL) while(p[n]!=cp[n]!=’\0’) n++; if(p[n]==’\0’) return NULL; return();}

函数String(n,"str")的功能是 ______。A.把数值型数据转换为字符串B.返回由n个字符组成的字符串C.从字符串中取出n个字符D.从字符串中第n个字符的位置开始取子字符串

字符串str由数字字符‘0’和‘1’组成(长度不超过8个字符),可看作二进制数,请补充函数fun(),该函数的功能是:把str字符串转换成十进制数,结果由函数返回。例如,输入“1001”,结果输出:9。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun()的横线上填入所编写的若干表达式或语句。试题程序:include<stdio.h>include<stdlib.h>include<string.h>int fun(char *str){int n;char *p=str;【 】;p++;while (*p){n=【 】;p++;}return【 】;}main(){char str[9];int i;int n;printf ("Enter a string made up of '0' and'1' digital character:");gets (str);if (strlen(str)>8){printf ("Error:string too longer!please input again !\n\n");exit(0);}for(i=0;str[i];i++)if(str[i]<'0'||str[i]>'1'){printf("Error:%c not is '0'and'1' digital character !\n\n",str[i]);exit(0);}printf("The original string:");puts(str);n=fun(str);printf("\n%s is convered to decimalnumber:%d\n\n",str,n);}

函数String(n,"str")的功能是( )。A.把数值型数据转换为字符串B.返回由n个字符组成的字符串C.从字符串中取出n个字符D.从字符串中第n个字符的位置开始取字符串