输出
null
#include <stdio.h> int main( void ) { int i = 10; const int *ptr = &i; *ptr = 100; printf ( "i = %d" , i); return 0; } |
(A) i=100 (B) i=10 (C) 编译错误 (D) 运行时错误 答复: (C) 说明: 请注意,ptr是指向常数的指针。因此,不能使用指针ptr更改指向的值。看见 C中的常量限定符 更多细节。 这个问题的小测验
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END