Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9.14 Fields of packed records (Example 8.8) cannot be passed by reference in Pas- cal. Likewise, when passing a subrange variable by reference, Pascal requires

image text in transcribed

9.14 Fields of packed records (Example 8.8) cannot be passed by reference in Pas- cal. Likewise, when passing a subrange variable by reference, Pascal requires that all possible values of the corresponding formal parameter be valid for the subrange: type small - 1. .100; R - record x, y : small; end; S - packed record x, y : smal1; end; var a : 1. .10; b : 1..1000; procedure foo(var n : small); begin n :- 100; writeln(a); end 9.8 Exercises 465 foo(b); foo(a); foo(c.x);(* ok *) foo(d.x);(* static semantic error *) ok) static semantic error *) Using what you have learned about parameter-passing modes, explain these language restrictions

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions