下列程序段的运行结果是( )。#include<stdio.h>void main(){ char str[]="ABC",*p=str; printf("%d\n",*(p+3));}

admin2010-05-22  16

问题 下列程序段的运行结果是(    )。#include<stdio.h>void main(){   char str[]="ABC",*p=str;    printf("%d\n",*(p+3));}

选项 A、67
B、0
C、字符’C’的地址
D、字符’C’

答案2

解析 先定义了一个指向字符型数组str的指针p,指针p指向数组str的首地址,p+3将指针指向str[3],又因为字符型数组在存放字符串时会自动在末尾加上’\0’,所以*(p+3)=0。
转载请注明原文地址:https://kaotiyun.com/show/F3Wp777K
0

相关试题推荐
最新回复(0)