开发者

C++ Memory management References [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_Python百科 Closed 12 years ago.

I am really confused about memory management in C++. What is the best reference (book or web) that deals with memory allocation, stack, heap, free store and scope & lifetime of variables.

Is there any resource that contrasts C++ memory allocation basics with that in C#?


The C++ FAQ deals with memory management issues extensively.


I strongly recommend Expert C Programming: Deep C Secrets for learning all about these little details. It's got nothing to do with C++, but you'll learn almost everything you asked about :) and the writing is superb, which is pretty rare with C++ books.


RAII in conjunction with smart pointers (std::unique_ptr, std::shared_ptr) is basically all you will need. If you stick with it you will get exception safe, memory leak free code :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜