单选题python中,p=‘hello world!’,则p[2:5]的值是()AllBlloCheDhello
单选题
python中,p=‘hello world!’,则p[2:5]的值是()
A
ll
B
llo
C
he
D
hello
参考解析
解析:
暂无解析
相关考题:
以下程序的输出结果是 ______。includeincludevoidmain(){char *p1=",he 以下程序的输出结果是 ______。 #include<iostream.h> #include<string.h> void main(){ char *p1=",hello",*p2="world!",str[50]:"Hii"; strcpy(str+2,p1); strcat(str,p2); cout<<str; }A.Hii,hello world!B.hello world!C.ii,hello world!D.Hi,hello world!
下列对字符数组进行初始化的语句正确的是A.char a []="Hello";B.char a[][]={'H','e','1','1','o');C.char a[5]="Hello";D.char a[2][5]={"Hello", "World"};p
以下程序的输出结果是 ______。includevoid main(){ char s1[]=”Hello”,s2[]="World 以下程序的输出结果是 ______。 #include<iostream.h> void main(){ char s1[]=”Hello”,s2[]="World"; char *p1,*p2; int i; p1=s1; p2=s2; for(i=0;i<5;i++) if(*(pl+i)==*(p2+i)) cout<<*(p1+i); }A.H1B.HoC.10D.1
下面的程序各自独立,请问执行下面的四个TestMemory 函数各有什么样的结果?①void GetMemory(char * p){p = (char * )malloc(100);}void TestMemory (void){char *str = NULL;GetMemory (str);strcpy(str, "hello world");prinff(str);}② char * GetMemory (void){char p[ ] = "hello world";return p;}void TestMemory (void){char * str = NULL;str = GetMemory( );printf(str);}③void GetMemory(char * * p, int num){* p = (char * )malloc(num);}void TestMemory (void){char * str = NULL;GetMemory(str, 100);strcpy( str, "hello" );printf(sir);}④void TestMemory (void){char *str = (char * )malloe(100);strepy (str, "hello" );free ( str );if(str ! = NULL){strepy( str, "world" );printf(str);}}
若有以下的定义, int a[ ]={1,2,3,4,5,6,7,8,9,10},*p=a;则值为3的表达式是 ______。A.p+=2,*(p++)B.p+=2,*++pC.p+=3,*p++D.p+=2,++*p
若有int x[]={1,2,3,4,5,6,7,8,9,10},*p=x;则值为4的表达式是 ______。A.p+=2,*(p++)B.p+=2,*++pC.p+=3,*p++D.p+=2,++*p
假定s被定义为指针类型char *的变量,初始指向的字符串为"Hello world!",若要使变量p指向s所指向的字符串,则p应定义为()。Achar *p=s;Bchar *p=s;Cchar *p;p=*s;Dchar *p; p=s;
单选题假定s被定义为指针类型char *的变量,初始指向的字符串为"Hello world!",若要使变量p指向s所指向的字符串,则p应定义为()。Achar *p=s;Bchar *p=s;Cchar *p;p=*s;Dchar *p; p=s;
单选题若有说明和语句:char str[]=Hello, *p; p=str;则此时*(p+5)中的值为( )。A'\0'B'o'C'o'的地址D不确定的值