Static Scope and Dynamic Scope

146 views Asked by At

I have this program:

var a, b:integer

procedure sub () 

var a,b:real;

begin

…

end

procedure sub1() 

var c:integer

begin

   …a…b…

end

begin

…

end
  1. With static scoping, a and b in sub1 are in main?
  2. With dynamic scoping, and with chain: main → sub → sub → sub1. Which variables a and b used in sub1?
0

There are 0 answers