若有以下程序段 char str[4][12]={ "aa","bbb","ccccc","d" } , *strp[4]; int i; for( i = 0; i< 4; i++ ) strp[i] = str[i]; 不能正确引用字符串的选项是( )

admin2020-04-18  26

问题 若有以下程序段
char str[4][12]={ "aa","bbb","ccccc","d" } , *strp[4];
int i;
for( i = 0; i< 4; i++ ) strp = str;
不能正确引用字符串的选项是( )。

选项 A、strp
B、str[0]
C、strp[3]
D、*strp

答案A

解析 在指针运算中,"*"为取值运算符,"&"为取地址运算符。表达式"p = NULL;"表示把空指针赋给指针变量p,而若要p指向变量x的地址需使用"p= &x;"的形式,所以答案选A)。
转载请注明原文地址:https://kaotiyun.com/show/ljCp777K
0

最新回复(0)