<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yohhoy</author_name>
  <author_url>https://blog.hatena.ne.jp/yohhoy/</author_url>
  <blog_title>yohhoyの日記</blog_title>
  <blog_url>https://yohhoy.hatenadiary.jp/</blog_url>
  <categories>
    <anon>C</anon>
    <anon>POSIX</anon>
    <anon>Linux</anon>
    <anon>gcc</anon>
  </categories>
  <description>C標準ライブラリscanf関数の書式指定%sにおいて、取得先の文字列バッファを動的確保する機能拡張。 // POSIX準拠システム char *s = NULL; scanf(&quot;%ms&quot;, &amp;s); // sはmallocで確保される ... free(s); まとめ： 標準C(ISO C)：該当機能は存在しない。メモリ領域を事前確保し、書式指定%sには領域サイズを指定すること。*1 POSIX準拠システム：動的メモリ確保を行うオプション文字mが存在する。 LSB準拠システム：動的メモリ確保を行うオプション文字aが存在するが、これはC99標準の16進浮動小数点%a指定と衝突する。*2 POSI…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20160825%2Fp1&quot; title=&quot;scanf文字列取得と動的メモリ確保 - yohhoyの日記&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>2016-08-25 00:00:00</published>
  <title>scanf文字列取得と動的メモリ確保</title>
  <type>rich</type>
  <url>https://yohhoy.hatenadiary.jp/entry/20160825/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
