Contrary to what anyone would say, knowing how memory works is important to know for any language, regardless of whether or not a specific language requires you to know it. For low level languages like C, memory addresses are very important to know because dedicating space to arrays or complex data structures requires a physical act of asking the operating system for a memory space of the appropriate size and you, the programmer, must be able to know how many bytes are needed. C offers helpful methods in this regard such as sizeof, but it doesn't pretend to hide it from you.
C++ only recently has moved towards removal of responsibility for programmers to free up memory allocated by having smart pointers. C# and Java do a fairly good of hiding it, but they are still there. For example in Java, if you compare two objects with ==
, you are comparing their pointers. You may not know the pointer values, but you must understand that if two objects return true using ==
operator, then they share the same space in memory. If you did not understand this concept, you might do things like comparing Strings with ==
, which may give you what you expect but maybe not. Since "mickey mouse" == "mickey mouse"
may or may not share the same memory address depending on how it is implemented in the virtual machine, Java programmers should never perform such checks using ==
, but rather with .equals()
instead, unless of course actually checking if they share the same memory is what you want.
Of course this is just one example. With increases in memory and advances in technology, memory management is going to become less important with time. However I assure you that the one day that your program is consuming as much memory as possible and your boss is bearing down on you to fix it, how memory is managed becomes very relevant very fast. :)
out
parameter in C#, for example. And, unless you explicitly take and pass a variable address in C, it is not guaranteed to have any address at all (e.g., it can be stored in a register, shared with the other variables).