以下程序执行后的输出结果是( )。
#include "string.h"
main( )
{ char *p[10]={ "abc","aabdfg","dcdbe","abbd","cd"};
printf("%d
",strlen(p[4]));
}
#include "string.h"
main( )
{ char *p[10]={ "abc","aabdfg","dcdbe","abbd","cd"};
printf("%d
",strlen(p[4]));
}
举一反三
- 有以下程序#include <stdio.h>#include <string.h>main(){ char str[ ][20]={“One*World”, “One*Dream!”},*p=str[1];printf(“%d,”,strlen(p));printf(“%s ”,p);}程序运行后的输出结果是()
- 以下程序 #include <string.h> main() {char str[][20]={"Hello","Beijing"},*p=str; printf("%d ",strlen(p+20)); } 程序运行后的输出结果是
- #include #include main() {char str[][20]={"One*World","One*Dream!"}; char *p=str[1]; printf(“%d,”,strlen(p)); printf("%s ",p); } 程序运行后的输出结果是
- 有以下程序 #include<string.h> #include<iostream.h> void main( ) { char*p="abcde\0fghjik\0"; cout<<strlen(p);} 程序运行后的输出结果是 A: 12 B: 15 C: 6 D: 5
- 有以下程序:#include <;stdio.h>;#include <;stdlib.h>;int main(){char *p,*q;p=(char*)malloc(sizeof(char)*20);q=p;scanf("%s%s",p,q);printf("%s %s",p,q);return 0;}程序执行后若从键盘上输入:abc└┘def↙,则输出结果是( )。 A: d└┘d B: def└┘def C: abc└┘d D: abc└┘def