自由
淡泊以明志, 宁静以致远.
Pages
Home
xiaogaozi's Secret Base
Monday, May 5, 2008
C++学习笔记(一) -- new & delete
如果改变了一个指向 new 操作符创建的对象的指针的值, 则在执行 delete 操作时, 会发生段错误. 特别是当这个指针指向的是一个数组时, 往往都会移动这个指针, 从而导致 delete 时发生段错误, 可以在 delete 之前将原数组的首地址赋值给该指针.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment