以下程序的输出结果是【 】。
include <iostream>
using namespace std;
int main()
{
char S[ ]="abcdef";
s[3]='\0';
cout<<s<<end1;
return 0;
}
第1题:
有以下程序: #include <string.h> main() {char *p="abcde\Ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是( )。
A.12
B.15
C.6
D.5
第2题:
以下程序的输出结果是( )。 #include<iostream> #include<stdlib> using namespace std; void func(char **m) { ++m; cout<<*m<<endl; } main() { static char *a[]={"MORNING","AFTERNOON","EVENING"); char **n; n=a; func(n); system("PAUSE"); return 0; }
A.为空
B.MORNING
C.AFTERNOON
D.EVENING
第3题:
有以下程序: #include<string.h> main( ) { char *p="abcde\0ghjik\0"; printf("%d\n",strlen(p) ); } 程序运行后的输出结果是
A.12
B.15
C.6
D.5
第4题:
以下程序的输出结果是( )。 #include<iostream.h> int fun (char*s) { char *p=s; while (*p!='\0,) p++: return (p-s): } void main() { cout<<fun (" ABCDEF ")<<endl: }
A.3
B.6
C.8
D.0
第5题:
有以下程序 #include.<string.h> main() { char *p="abcde\ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是
A.12
B.15
C.6
D.5