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

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

下列给定程序中,函数fun()的功能是:从N个字符串中找出最长的那个中,并将其地址作为函数值返回。各字符串在主函数中输入,并放入一个字符串数组中。请改正程序中的错误,使它能得出正确的结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。试题程序:include <string.h>include <stdio.h>define N 5define M 81/*************found**************/fun(char (*sq) [N]){int i; char *sp;sp=sq[0];for{i=0;i<N;i++)if(strlen(sp)<strlen(sq[i]))sp=sq[i];/*************found**************/return sq;}main (){char str[N][M], *longest; int i;printf("Enter %d lines:\n ",N);for(i=0;i<N;i++) gets(str[i]);printf("\nThe %d string :\n ",N);for(i=0;i<N;i++) puts(str[i]);longest=fun(str);printf("\nThe longest string :\n ");puts(longest);}

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

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

函数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个字符的位置开始取字符串