问题

有以下程序

#include <stdio.h>

#include <string.h>

main()

{ char a[10]="abcd";

printf("%d,%d\n",strlen(a),sizeof(a));

}

程序运行后的输出结果是

A)7,4

B)4,10

C)8,8

D)10,10

参考答案
您可能感兴趣的试题
  • 下面是有关 C 语言字符数组的描述,其中错误的是A) 不可以用赋值语句给字符数组名赋字符串B) 可以用输入语句把字符串整体输入给字符数组C) 字符数组中的内容不一定是字符串D) 字符数组只能存放字符串
  • 下列函数的功能是fun(char *a,char *b){ while((*b=*a)!= \0) {a++,b++;} }A) 将 a 所指字符串赋给 b 所指空间B) 使指针 b 指向 a 所
  • 设有以下函数void fun(int n,char * s) { …… }则下面对函数指针的定义和赋值均是正确的是A)void (*pf)(); pf=fun;B)viod *pf(); pf=fun
  • 34 ) 有以下程序#include int f(int n);main(){ int a=3,s;s=f(a);s=s+f(a);printf(%d\n,s);}int f(i
  • 有以下程序#include #define f(x) x*x*xmain(){ int a=3,s,t;s=f(a+1);t=f((a+1));printf(%d,%d\n,s,
  • 下面结构体的定义语句中,错误的是A)struct ord {int x;int y;int z;}; struct ord a;B)struct ord {int x;int y;int z;} st