Why can't this friend function access the private variables?
为什么这不可以友元函数访问私有变量?
Let's see an example of where some private variables will be useful. Consider this subroutine.
如下示例展示私有变量在哪里会很有用。
Loops and such constructs do not open a new scope, so there is no way to create private variables within them.
这种循环和建构不打开一个新的范围,所以是没有出路的创造私人变数。
应用推荐