以下几对最合适的匹配
null
X: m=malloc(5); m= NULL; 1: using dangling pointers Y: free(n); n->value=5; 2: using uninitialized pointers Z: char *p; *p = ’a’; 3. lost memory is:
(A) X-1 Y-3 Z-2
(B) (X-2 Y-1 Z-3 (C) X-3 Y-2 Z–1 (D) X-3 Y-1 Z–2 答复: (D) 说明: 看见 https://www.geeksforgeeks.org/c-dynamic-memory-allocation-question-1/ 这个问题的小测验
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END