<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>stfuawsc</author_name>
  <author_url>https://blog.hatena.ne.jp/stfuawsc/</author_url>
  <blog_title>苔の一念岩をも通す ~目指せいつかはプログラマ~</blog_title>
  <blog_url>https://stfuawsc.hatenadiary.org/</blog_url>
  <categories>
    <anon>C</anon>
  </categories>
  <description>ヤボ用でしばらく更新出来なかったので、今日からまた再開(´・ω・`) Cの標準ライブラリにあるgets()は、入力文字数のチェックをしないのであまり推奨されないらしい。 実際コンパイラ(gcc)も警告を出す。 そこで、同じ標準ライブラリのfgets()を使うのが良いそうだ。 ;; stdio.hを忘れずに char *fgets(char *s, int n, FILE *resource)これで、第3引数に標準入力(stdin)を指定すればOK。 ポイントは、gets()が改行を自動除去してくれるのに対し、fgets()は除去してくれない点。 打倒!!ポインタ!!ばかり意識していたけど、C言…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fstfuawsc.hatenadiary.org%2Fentry%2F20090512%2F1242138172&quot; title=&quot;fgetsで標準入力を受け取る - 苔の一念岩をも通す ~目指せいつかはプログラマ~&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-05-12 23:22:52</published>
  <title>fgetsで標準入力を受け取る</title>
  <type>rich</type>
  <url>https://stfuawsc.hatenadiary.org/entry/20090512/1242138172</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
