edited by
10,074 views
40 votes
40 votes

In the C language:

  1. At most one activation record exists between the current activation record and the activation record for the main
  2. The number of activation records between the current activation record and the activation records from the main depends on the actual function calling sequence.
  3. The visibility of global variables depends on the actual function calling sequence
  4. Recursion requires the activation record for the recursive function to be saved in a different stack before the recursive function can be called.
edited by

1 Answer

Best answer
95 votes
95 votes
  1. Each function call starts a new activation record and since C allows nested function calls more than one activation record can exist between the current activation record and main.
  2. TRUE
  3. Since, C uses static scoping, the actual function calling sequence has no impact on the visibility of global variables. If a variable is not found in the current activation record, it is looked in global address space and this is independent of the calling sequence.
  4. All function calls- whether recursive or not uses the same stack for saving the activation record. There is no need for a different stack as for C compiler a recursive function call and a normal function call make no difference.
edited by
Answer:

Related questions

39 votes
39 votes
4 answers
1
Kathleen asked Sep 15, 2014
27,644 views
Consider the following declaration of a two-dimensional array in C:char $a[100][100]$;Assuming that the main memory is byte-addressable and that the array is stored start...
35 votes
35 votes
3 answers
2
Kathleen asked Sep 15, 2014
10,071 views
The C language is:A context free languageA context sensitive languageA regular languageParsable fully only by a Turing machine
18 votes
18 votes
2 answers
4