<!DOCTYPE html>
<html data-lt-installed="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body style="padding-bottom: 1px;">
<span style="white-space: pre-wrap">
</span>
<blockquote type="cite"
cite="mid:5A8CD9DB-1FC7-48FF-A878-7563A964F4B0@gmail.com">
<pre class="moz-quote-pre" wrap="">1) what does "i := x - x;" do and what is it's purpose and why doesn't "x + x" work the same? </pre>
</blockquote>
<p>Subtracting pointers may be useful if they point to consecutive
memory. The Result is the number of bytes between both addresses.</p>
<p>Adding pointers is useless, you would get a pointer pointing to
some address in address space which has no relation to the
pointers — presumably accessing it would rise an error.</p>
<p>Therefore, it is a good idea to let the compiler prevent such
mistakes.<br>
</p>
<blockquote type="cite"
cite="mid:5A8CD9DB-1FC7-48FF-A878-7563A964F4B0@gmail.com">
<pre class="moz-quote-pre" wrap="">2) I've used pointer equality of course but what does "x > p" do and what is its purpose? </pre>
</blockquote>
<p>It may be useful if pointers do point into a continuous data
object, e.g. a write-pointer inside a buffer.</p>
<p>Elmar</p>
<p><br>
</p>
<p><br>
</p>
</body>
<lt-container></lt-container>
</html>