Sujet : Re: What is OOP?
De : richard (at) *nospam* damon-family.org (Richard Damon)
Groupes : comp.lang.c++Date : 01. Dec 2024, 23:02:11
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <3a72f45ce7a77c6272e207f009ba09aece96f8df@i2pn2.org>
References : 1
User-Agent : Mozilla Thunderbird
On 12/1/24 12:17 PM, wij wrote:
OTOH, in C/C++, every memory objects/function has address, the language cannot
pretend it is not actually dealing with a large array of raw 'bytes' and its
restrictions (and restrict by Turing Machine). I think that is generally where
many programming problems from. And, understanding C or assembly is nearly a must
before understanding C++, otherwise, no real meaning, simply put.
Except that by the rules of pointes in C (and C++) you can not convert a pointer to one object to a pointer to some other object that isn't within some defined larger object that the first object was also in.
While you can convert any pointer to some interger type, or into a char* pointer, there is nothing that gaurentes that these somehow correspond to "raw memory" address in some big raw memory array that you can go elsewhere with.
Yes, currently with most processors, it will just work, but nothing requires that to work, and in previous segmented architectures, it simply wasn't true.