{"url":"https://ita.hatenadiary.jp/entry/20050209/p1","type":"rich","blog_url":"https://ita.hatenadiary.jp/","version":"1.0","height":"190","blog_title":"ita\u2019s diary","width":"100%","provider_name":"Hatena Blog","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fita.hatenadiary.jp%2Fentry%2F20050209%2Fp1\" title=\" C++ - ita\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"ita","provider_url":"https://hatena.blog","published":"2005-02-09 00:00:00","author_url":"https://blog.hatena.ne.jp/ita/","description":"\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u305f\u3044\u3093\u3067\u3059\u304c\u3001 //\u30af\u30e9\u30b9\u5b9a\u7fa9 class myclass { public: int z; void (*func)(int x); }; //\u30af\u30e9\u30b9\u3068\u95a2\u4fc2\u306a\u3044\u5909\u6570 int myint1, myint2; // func\u306e\u884c\u304d\u5148 void myclass::sub1(int x) { z=x + myint1; } void myclass::sub2(int x) { z=x + myint2; } int main(){ myclass a,b; a.func = sub1; b.func = sub2; }sub1, sub2 \u306f myclass \u306e\u30e1\u30f3\u30d0\u3058\u3083\u306a\u2026","categories":["Geek","J"],"title":" C++"}