10,6,4,6
11,6,11,6
11,6,1,6
10,7,1,7
第1题:
以下程序的输出结果是( ) #include<stdio.h> #include<string.h> main() {char str[12]={'s','t','r','i','n','g'}; printf("%d\n",strlen(str)); }
A.6
B.7
C.11
D.12
第2题:
有以下程序: #include <string.h> main() { char str[][20]={"Hello","Beijing"}*p=str; printf("%\n",strlen(p+20)); } 程序运行后的输出结果是
A.0
B.5
C.7
D.20
第3题:
以下程序的输出结果是【 】。
include <stdio.h>
include <string.h>
char *fun(char *0
{ char *p--t;
return (p+strlen(t)/2);
}
main()
{ char *str="abcdefgh";
str=ftm(str);
puts(str);
}
第4题:
以下程序的输出结果是( )。 #include <stdio.h> #include <string.h> main() { char str[12]={'s','t','r','i','n','g'}; printf("%d\n",strlen(str) ); }
A.6
B.7
C.11
D.12
第5题:
下列程序在32位linux或unix中的结果是什么?
func(char *str)
{
printf(" %d",sizeof(str));
printf(" %d",strlen(str));
}
main()
{
char a[]="123456789";
printf(" %d",sizeof(a));
printf(" %d",strlen(a));
func(a);
}
10 9 4 9
第6题:
有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t){ char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);}main( ){ char str[10] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
第7题:
有以下程序: #include <stdio.h> #include <string.h> main() { char str[][20]={"Hello","Beijing"},*P=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是( )。
A.0
B.5
C.7
D.20
第8题:
以下程序的输出结果是_[13]_______
#include <stdio.h>
#include <string.h>
char *fun(char *t)
{ char *p=t;
return(p+strlen(t)/2);
}
main()
{ char *str="abcdefgh";
str=fun(str);
puts(str);
}
efgh
第9题:
6
7
11
12
第10题:
NAME0
NAMEE
NAME
NAME\0
第11题:
9,7,4,7
8,6,9,6
8,6,3,6
10,8,5,8
第12题:
13,13
13,14
13,15
14,15
第13题:
有以下程序: #include<string.h> main() { char str[][20]={"Hello","Beijing"),*p=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是( )。
A.0
B.5
C.7
D.20
第14题:
有以下程序 #include <string.h> main() {char str[][20]={"Hello","Beijing"},*p=str; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是
A.0
B.5
C.7
D.20
第15题:
有以下程序: #include 〈iostream〉 #include 〈string〉 using namespace std; class visited { private: int number; char *name; public: static int glob; void set mes(char *a); }; void visited::set mes(char *a) { name=new char[strlen(A) +1]; strcpy(name,A) ; number=++glob; } int visited::glob-O; int main() { visited person[10]; int i; char str[8]; for(i=0;i<5;i++) { cin>>str; person[i] .set mes(str); } cout<
A.5
B.4
C.3
D.2
第16题:
下列程序在32位linux或unix中的结果是什么?
func(char *str)
{
printf("%d",sizeof(str));
printf("%d",strlen(str));
}
main()
{
char a[]="123456789";
printf("%d",sizeof(a));
func(a);
}
10 4 9
第17题:
若有如下程序; main() {char a[]="china\0name\0"; printf("%d,",strlen(A) ); printf("%d\n",sizeof(A) ); } 则程序运行后的输出结果是( )
A.5,11
B.5,12
C.11,11
D.12,12
第18题:
A.13,13
B.13,14
C.13,15
D.14,15
第19题:
以下程序的输出结果是【 】。
include <stdio.h>
include <string.h>
char *fun(char *t)
{ char *p=t;
return (p+strlen(t)/2);
}
main()
{ char *str="abcdefgh";
str=ftm(str);
puts(str);
}
第20题:
以下程序的输出结果是() #include
第21题:
6
7
8
12
第22题:
9,One*World
9,One*Dream!
10,One*Dream!
10,One*World
第23题:
STRENG
STRIEG
STREN
STREN0