<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>javascripter</author_name>
  <author_url>https://blog.hatena.ne.jp/javascripter/</author_url>
  <blog_title>素人がプログラミングを勉強していたブログ</blog_title>
  <blog_url>https://javascripter.hatenablog.com/</blog_url>
  <categories>
    <anon>c</anon>
  </categories>
  <description>printfの第二以降の引数にいろいろな型の物を渡せる仕組みについて。 まず、可変長引数を使うためにstdarg.hを#includeする。 #include &lt;stdarg.h&gt; で、 void myprintf(char *format, ...); のようにプロトタイプを宣言する。 関数の可変部はどんな型でも受け取ることができ、va_arg(ap, type)のように引数を取り出す時に型を指定する。 つまり、formatに&quot;%d&quot;が渡されたら、n = va_arg(ap, int)になるようなswitch文を作る。 #include &lt;stdio.h&gt; #include &lt;stdarg.…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjavascripter.hatenablog.com%2Fentry%2F20090210%2F1234255818&quot; title=&quot;printfの可変長引数と型 - 素人がプログラミングを勉強していたブログ&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-02-10 17:50:18</published>
  <title>printfの可変長引数と型</title>
  <type>rich</type>
  <url>https://javascripter.hatenablog.com/entry/20090210/1234255818</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
