On Fri, 2012-09-07, Nick Keighley wrote:
....
>> So why would C++ allow that be coded? Has to be a reason.
>
> C++ (and its ancestor, C) implicitly assumes the programmer knows what
> he is doing. If you want to stuff bits into arbitary memory locations
> then C++ will allow you to do this (or can be made to on many
> implementations). Why would you do this? Memory mapped hardware,
> access to special memory (EEPROM, DMA).
Put differently, C++ was designed to be useful for (among other
things) low-level systems programming. "Leave no room for another
lower-level language" was how Stroustrup put it, I think.
> If you don't know what you are doing use Java or something.
Or use C++ on a modern computer with memory protection provided by the
OS and hardware ...
I suspect the OP misunderstood whatever material he was reading,
because corrupting other processes' memory is something very few
programmers have to worry about, no matter what language they use.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
|