<?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>C++</anon>
  </categories>
  <description>プログラミング言語C/C++における、1文字の数字から1桁の整数値へ変換するイディオム ch - '0' について。C/C++言語仕様では、数字の文字コード'0'〜'9'がその並び順で連続かつ隣接すると保証する。このため変換元文字chから数字0の文字コード'0'を減算する下記処理は、処理系やソースコードの文字集合によらず正常動作する。*1 int ch = /*...*/; assert(isdigit(ch)); // chは任意の数字 int n = ch - '0'; // 数字から数値へ変換 C99 5.2.1/p3より一部引用（下線部は強調）。 3 Both the basic so…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20170103%2Fp1&quot; title=&quot;数字から数値への変換: ch - &amp;#39;0&amp;#39; - 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>2017-01-03 00:00:00</published>
  <title>数字から数値への変換: ch - '0'</title>
  <type>rich</type>
  <url>https://yohhoy.hatenadiary.jp/entry/20170103/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
