Question
List all the variables, along with the program units where they are declared that are visible in the bodies of sub, sub2, and sub3, assum-
List all the variables, along with the program units where they are declared that are visible in the bodies of sub, sub2, and sub3, assum- ing static scoping is used. 10. Consider the following program: void fun (void) { int a, b, c; /* definition 1 / while (...) int b, c, d; /*definition 2 / while (...) Problem Set 239 int c, d, e; /* definition 3 */ > 1 } For each of the four marked points in this function, list each visible vari- able, along with the number of the definition statement that defines it. 11. Consider the following skal program vold turvold prototype void tuna old prototype vold und vota prototype vold Inta BC veidunt veld) Lat b, c, di void runoid Inte, 1 void tunsold Lat det Give the following calling and in this ing is ved what variables are hibe daring to the last fun tion called Include with each visible variable the name of the function in which it was defined main call run, runt call tud fun calle und main calls fumltunt calle tu main
hibe daring to the last fun tion called Include with each visible variable the name of the function in which it was defined main call run, runt call tud fun calle und main calls fumltunt calle tu main calls and all run, rund calls font 240 Chapters used and Scopes main call fun tua calle tuni main calle tund funt calls fun fun call fun Emain calle tuns un calle und una calle tunt 12. Consider the following program, written a JavaScripe-like winter 1 main program function var a: Y function var, b. function Given the following calling sequences and coming that dynamic scop ing ned, what variables are visible during execution of the last pro matved include with each visible acable the name of the unit where it is declared main called calls call us in call subsubt alle c. main collab wu call calle wbt. main calle sub sub calls main callbaubt call baba calle muba Emain calls abuba calle kauba calle wbt.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started