若有如下定义语句:int x;则经过( )后,语句*px=0;,可将x值置为0。
A: int *px;
B: int *px=&x;
C: float *px;
D: float *px=&x;
A: int *px;
B: int *px=&x;
C: float *px;
D: float *px=&x;
举一反三
- 执行下列语句后的结果为(). int x=3,y; int *px=&x; y=*px++;
- 有以下程序段:#include int main(){int x[ ] = {10, 20, 30}; int *px = x;printf("%d, ", ++*px); printf("%d, ", *px); px = x;printf("%d, ", (*px)++); printf("%d, ", *px); px = x;printf("%d, ", *px++); printf("%d, ", *px); px = x;printf("%d, ", *++px); printf("%d\n", *px);return 0;}程序运行后的输出结果是( ) A: 20, 10, 11, 10, 11, 10, 11, 10 B: 11, 11, 11, 12, 12, 20, 20, 20 C: 20, 10, 11, 20, 11, 12, 20, 20 D: 11, 11, 11, 12, 12, 13, 20, 20
- 若变量已正确定义,表达式()可以使指针px指向变量x。 A: px=&x B: px=x C: *px=&x D: *px=*x
- 有以下程序段:#include stdio.hint main(){int x[ ] = {10, 20, 30}; int *px = x;printf(%d, , ++*px); printf(%d, , *px); px = x;printf(%d, , (*px)++); printf(%d, , *px); px = x;printf(%d, , *px++); printf(%d, , *px); px = x;printf(%d, , *++px); printf(%d\n, *px);return 0;}程序运行后的输出结果是( )。 A: 11, 11, 11, 12, 12, 20, 20, 20 B: 20, 10, 11, 10, 11, 10, 11, 10 C: 11, 11, 11, 12, 12, 13, 20, 20 D: 20, 10, 11, 20, 11, 12, 20, 20
- 若有定义语句:doublex,y,*px,*py,执行了px=&x,py=之后,正确的输入语句是