<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takehikom</author_name>
  <author_url>https://blog.hatena.ne.jp/takehikom/</author_url>
  <blog_title>わさっきhb</blog_title>
  <blog_url>https://takehikom.hateblo.jp/</blog_url>
  <categories>
    <anon>情報教育</anon>
    <anon>C</anon>
  </categories>
  <description>いきなりですが問題です． ポインタ変数pとqが，ある文字列のどこかの位置を指し示しているものとする．このとき，その中間の位置(ポインタ値)をCの式として表しなさい． で，答えです． p + (q - p) / 2 pとqのどちらが大きくても，それなりの中間の位置になります．q-pが偶数なら，ちゃんと中間の位置になります．奇数なら，つまり例えば&quot;ABCD&quot;の先頭をp，末尾をqが指し示しているなら，上の式で2文字目を指し示すポインタ値になりますが，pとqが逆なら，3文字目になるでしょう． この問題，「中間だから平均値」ということで， (p + q) / 2 と書いたら間違いです． というのも，アド…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakehikom.hateblo.jp%2Fentry%2F20061117%2F1163710988&quot; title=&quot; アドレス演算と時間演算 - わさっきhb&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>2006-11-17 06:03:08</published>
  <title> アドレス演算と時間演算</title>
  <type>rich</type>
  <url>https://takehikom.hateblo.jp/entry/20061117/1163710988</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
