<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>iww</author_name>
  <author_url>https://blog.hatena.ne.jp/iww/</author_url>
  <blog_title>揮発性のメモ２</blog_title>
  <blog_url>https://iww.hateblo.jp/</blog_url>
  <categories>
    <anon>C</anon>
  </categories>
  <description>「数字,数字,文字列,文字列」みたいなカンマ区切りの文字列をscanfで分解する。 空白とかのトリミング scanfは文字列を読み込みときにバッファの最大長を指定できるので、これを使えばバッファオーバーランは発生しない。 また、フォーマット文中の空白は「0バイト以上のホワイトスペース」として扱われる。 scanf( &quot; %4s &quot;,str )と書けば、「ホワイトスペースを含まない4バイト以内の文字列」がstrに入る。 \0の分 1バイト余分に確保しておく。 カンマ区切りとか %sは「ホワイトスペース以外の文字列」を意味するので、文字列とカンマをくっつけて書くとカンマも一緒に取り込まれてしまう。…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fiww.hateblo.jp%2Fentry%2F20090615%2Fscanf&quot; title=&quot;scanfでcsvを分解する - 揮発性のメモ２&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>2009-06-15 00:00:00</published>
  <title>scanfでcsvを分解する</title>
  <type>rich</type>
  <url>https://iww.hateblo.jp/entry/20090615/scanf</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
