<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>madotubo</author_name>
  <author_url>https://blog.hatena.ne.jp/madotubo/</author_url>
  <blog_title>言語解明</blog_title>
  <blog_url>https://madotubo.hatenadiary.org/</blog_url>
  <categories>
    <anon>C</anon>
  </categories>
  <description>配列を使うときは前もってメモリを確保しておかなければならないけど、たくさん確保した割りに短い文字列だった時とかに、メモリが無駄になってしまう。そんなときは、malloc関数を使って、プログラムを実行したときにメモリを確保すると効率がいい。 #include &lt;stdlib.h&gt; void *malloc(size_t size); mallocを使う場合はstdlib.hをインクルードしなければならない。また、確保したメモリは最後にfree関数を使って解放する。プログラムを終了した後も残ってしまうため。 #include&lt;stdio.h&gt; #include&lt;Stdlib.h&gt; int main…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmadotubo.hatenadiary.org%2Fentry%2F20081212%2F1229316128&quot; title=&quot;動的にメモリを確保する関数 - 言語解明&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>2008-12-12 13:42:08</published>
  <title>動的にメモリを確保する関数</title>
  <type>rich</type>
  <url>https://madotubo.hatenadiary.org/entry/20081212/1229316128</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
