1) Given the following ‘generic’ program. var aVar; aVar = 10; sub1(); function sub1 () { Sub2(); Print (“ aVar = “ aVar + “\n”); } function sub2() { var aVar; aVar = 4; } What would be output under static-scoping rules? What would be output under dynamic-scoping rules? 2) Discuss and compare the following memory allocation strategies for variables, give an example of how Java and/or Python uses each: Stack-Dynamic Explicit Heap-Dynamic Implicit Heap-Dynamic 3) What is a descriptor? What are the required entries in a Java array descriptor for an int and when must they be stored (compile-time or run-time)? Compare this to a Python descriptor for an int. 4) Identify and explain the two common problems with C++ pointers?
Are there any questions left?
New questions in the section Engineering
-
Engineering 2022-05-15 19:04:59