Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Memory Addressing

Reply
Thread Tools

Memory Addressing

 
 
army1987
Guest
Posts: n/a
 
      09-07-2012
On Fri, 07 Sep 2012 21:59:46 +1000, moo wrote:

> I was under the impression it was a high level language.


It's higher-level than machine code, assembly and C, but lower-level than
pretty much anything else in common use today.



--
[ T H I S S P A C E I S F O R R E N T ]
Troppo poca cultura ci rende ignoranti, troppa ci rende folli.
-- fathermckenzie di it.cultura.linguistica.italiano
<http://xkcd.com/397/>
 
Reply With Quote
 
 
 
 
Jorgen Grahn
Guest
Posts: n/a
 
      09-08-2012
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 .
 
Reply With Quote
 
 
 
 
Kelly Fergason
Guest
Posts: n/a
 
      09-08-2012
moo <> wrote:
> If you were to designate a specific memory address for a variable and the
> compiled program was run on a system with that address in use already what would happen?


to answer the question, the value at the address would be overwritten with
the new value.
i don't know what use this is in modern os's, if it is even possible, but
doing this on embedded boards was normal.
specifically in my case, a motorola 68hc11 evb with small-c.

bare metal programming in c. those were the days.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is memory addressing ? cnoe C Programming 15 11-30-2008 05:15 PM
Memory addressing Simon Berube Python 12 04-29-2007 07:03 AM
vhdl complex memory addressing Alex VHDL 4 02-02-2006 09:30 AM
Indirect Memory Addressing Larry Bates Python 2 06-04-2004 06:49 AM
MEMORY ADDRESSING QUESTION Rob Computer Information 2 05-27-2004 12:35 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57