{"image_url":null,"title":"\u914d\u5217\u6709\u52b9\u7bc4\u56f2\u5916\u3092\u6307\u3059\u30dd\u30a4\u30f3\u30bf\u5024\u306f\u5b58\u5728\u304c\u8a31\u3055\u308c\u306a\u3044","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20180604%2Fp1\" title=\"\u914d\u5217\u6709\u52b9\u7bc4\u56f2\u5916\u3092\u6307\u3059\u30dd\u30a4\u30f3\u30bf\u5024\u306f\u5b58\u5728\u304c\u8a31\u3055\u308c\u306a\u3044 - yohhoy\u306e\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>","height":"190","description":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9eC/C++\u306b\u304a\u3051\u308b\u3001\u914d\u5217\u578b\u3068\u30dd\u30a4\u30f3\u30bf\u6f14\u7b97\u306e\u77e5\u3089\u308c\u3056\u308b*1\u843d\u3068\u3057\u7a74\u3002\u554f\u984c\uff1a\u4e0b\u8a18sum_odd\u95a2\u6570\u306e\u5b9f\u884c\u7d50\u679c\u306f\uff1f int data[5] = { 1, 2, 3, 4, 5 }; // \u5947\u6570\u756a\u76ee\u306e\u8981\u7d20\u5024\u306e\u307f\u3092\u5408\u8a08\u3059\u308b int sum_odd() { int s = 0; int *endp = data + 5; // \u914d\u5217\u672b\u5c3e\u8981\u7d20\u306e\u6b21\u4f4d\u7f6e // \u30dd\u30a4\u30f3\u30bf\u5024p \u304c endp \u3092\u8d8a\u3048\u308b\u307e\u3067\u30eb\u30fc\u30d7\u51e6\u7406 for (int *p = data; p < endp; p += 2) { s += *p; } return s; } \u7b54\u3048\uff1a\u672a\u5b9a\u7fa9\u52d5\u4f5c(undefined behavior)\u3002\u2026","type":"rich","version":"1.0","url":"https://yohhoy.hatenadiary.jp/entry/20180604/p1","published":"2018-06-04 00:00:00","blog_url":"https://yohhoy.hatenadiary.jp/","provider_name":"Hatena Blog","blog_title":"yohhoy\u306e\u65e5\u8a18","categories":["C","C++"],"author_url":"https://blog.hatena.ne.jp/yohhoy/","author_name":"yohhoy","provider_url":"https://hatena.blog","width":"100%"}