bingohuang
Effective Go 中英双语版

Updated 3 days ago

jane1993 (@jane1993) started discussion #23

2 years ago · 0 comments

Open

请注意,返回一个局部变量的地址完全没有问题,这点与 C 不同。该局部变量对应的数据 在函数返回后依然有效。实际上,每当获取一个复合字面的地址时,都将为一个新的实例分配内存, 因此我们可以将上面的最后两行代码合并:

数据 (Edit this file)

上面二者是等价的

No description provided.

No comments on this discussion.


to join this conversation on GitBook. Already have an account? Sign in to comment
Notifications

You’re not receiving notifications from this thread.


1 participant