{"blog_url":"https://toburau.hatenablog.jp/","author_url":"https://blog.hatena.ne.jp/toburau/","published":"2008-11-06 00:39:09","image_url":null,"blog_title":"\u30b2\u30fc\u30e0\u304c\u4f5c\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u307e\u3067\u304c\u3093\u3070\u308b\u65e5\u8a18","provider_url":"https://hatena.blog","height":"190","provider_name":"Hatena Blog","categories":["\u52c9\u5f37","C++"],"title":"\u30d5\u30ec\u30f3\u30c9\u95a2\u6570","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftoburau.hatenablog.jp%2Fentry%2F20081106%2F1225985949\" title=\"\u30d5\u30ec\u30f3\u30c9\u95a2\u6570 - \u30b2\u30fc\u30e0\u304c\u4f5c\u308c\u308b\u3088\u3046\u306b\u306a\u308b\u307e\u3067\u304c\u3093\u3070\u308b\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://toburau.hatenablog.jp/entry/20081106/1225985949","author_name":"toburau","version":"1.0","description":"\u672c\u3092\u8aad\u307f\u306a\u304c\u3089C++\u306e\u52c9\u5f37\u4e2d\u30022\u30da\u30fc\u30b8\u3002 \u4eca\u56de\u306f\u30d5\u30ec\u30f3\u30c9\u95a2\u6570\u306b\u3064\u3044\u3066\u3002 friend\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4ed8\u3051\u305f\u95a2\u6570\u306f\u30af\u30e9\u30b9\u306eprivate\u30e1\u30f3\u30d0\u3078\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u304c\u3042\u308b\u3002 class Test { private: int m_num; public: Test(int num) { m_num = num; } friend void func(Test t); }; void func(Test t) { cout << t.m_num; } int main() { Test t(123); func(t); } \u3053\u306e\u4f8b\u3060\u3068func\u304c\u30d5\u30ec\u30f3\u30c9\u95a2\u6570\u3068\u306a\u308b\u3002","width":"100%","type":"rich"}