Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【问题求解】关于理解“new() 不会初始化内存,只会将内存置零”的疑问 #12

Open
RobinTsai opened this issue Dec 4, 2020 · 0 comments

Comments

@RobinTsai
Copy link

RobinTsai commented Dec 4, 2020

社区的 gopher 们,大家好,本人最近在拜读此项目,理解上有些偏差,所以来此求解,希望能够得到一些帮助。

【问题】

项目 08_Data.md 一节中提到 “这(new 分配)是个用来分配内存的内建函数,……,它不会初始化内存,只会将内存置零。……”

请问这句话改怎么理解,它既然不初始化内存,怎么又有 T 的零值属性呢?我认为我对“什么是分配内存,什么是初始化内存”这个理解不对,请大佬们帮助一下。谢谢大家了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant