{"url":"https://ku0522.hatenadiary.org/entry/20091215/1260805575","categories":["C++"],"image_url":null,"height":"190","version":"1.0","published":"2009-12-15 00:46:15","author_name":"ku0522","title":"C++\u306estatic\u3092\u77e5\u308d\u3046\uff01","width":"100%","type":"rich","blog_url":"https://ku0522.hatenadiary.org/","author_url":"https://blog.hatena.ne.jp/ku0522/","provider_name":"Hatena Blog","blog_title":"\u30ed\u30c3\u30af\u30b9\u30bf\u30fc\u306b\u306a\u308a\u305f\u3044","description":"C++\u306b\u3082PHP\u3068\u304a\u306a\u3058\u3088\u3046\u306bstatic\u304c\u3042\u308a\u307e\u3059\u3002 \u9a5a\u304f\u3079\u304d\u3053\u3068\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306fgcc\u3067\u6587\u53e5\u3082\u8a00\u308f\u308c\u305a\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u3066\u3057\u304b\u3082\u671f\u5f85\u901a\u308a\u306b\u52d5\u304d\u307e\u3059\u3002 class A { public: static int add(int n, int m) { return n+m; } }; #include <iostream> int main() { A *p = new A; std::cout << p->add(1,2) << std::endl; return 0; } \u306a\u305c\u30d7\u30ed\u30b0\u30e9\u30de\u306fstatic\u3092\u77e5\u3089\u306a\u3044\u306e\u304b\u3002","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fku0522.hatenadiary.org%2Fentry%2F20091215%2F1260805575\" title=\"C++\u306estatic\u3092\u77e5\u308d\u3046\uff01 - \u30ed\u30c3\u30af\u30b9\u30bf\u30fc\u306b\u306a\u308a\u305f\u3044\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>"}