<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sorayukinoyume</author_name>
  <author_url>https://blog.hatena.ne.jp/sorayukinoyume/</author_url>
  <blog_title>雷鳴の日記</blog_title>
  <blog_url>https://sorayukinoyume.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>Ｃ++言語の勉強する前にＣ言語はできる人が多いらしい。 Ｃ++言語はＣにの互換性はいい。Ｃ++にＣ言語のmallocのようなものがあります。それはnew演算子だ。 似てるけど不同があります。特にメモリが不足の時。会社の同僚はまだ「new演算子を使ってメモリが不足の時ゼロ値を返す」と思ってる。 malloc関数こそゼロ値を返すじゃないか＞＜同僚は書いたコードがこのようです char* buffer = new char[bufsize]; if(!buffer) { ...実はnew演算子はメモリが不足の時、ゼロ値を返さない。代わりに例外を起こる。多くの資料にこれを載ってるのに知らない人がまだ多…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsorayukinoyume.hatenadiary.org%2Fentry%2F20101110&quot; title=&quot;malloc関数とnew演算子 - 雷鳴の日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2010-11-10 00:00:00</published>
  <title>malloc関数とnew演算子</title>
  <type>rich</type>
  <url>https://sorayukinoyume.hatenadiary.org/entry/20101110</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
