Liste des Groupes | Revenir à c arch |
On Tue, 8 Oct 2024 6:16:12 +0000, Lawrence D'Oliveiro wrote:No, you can't - unless the pointers are of compatible types, and each points to a sub-object within the same encompassing object. So if you have two pointers that point within the same array, you can subtract them. If they point to different objects, trying to subtract them is undefined behaviour.
On Mon, 7 Oct 2024 23:13:25 +0000, MitchAlsup1 wrote:In pascal you cannot subtract pointers to different objects,
>Is protected mode not "how Pascal" thinks of memory and objects in>
memory ??
How is that different from C?
in C you can.
malloc() does not need a flat memory space. C does not need a flat memory space. Indeed, people use C all the time on systems where memory is disjoint.The Algol family of block structure gave the illusion that flatWhereas by the time 286 got out, everybody was wanting flat memory ala>
C.
When did they not want that?
was less necessary and it could all be done with lexical address-
ing and block scoping rules.
Then malloc() and mmap() came along.
Les messages affichés proviennent d'usenet.