A variant record in Pascal is defined by type varirec = record number :…

GATE · 1995 · CS · Question 2 subparts

A variant record in Pascal is defined by

type varirec = record
  number : integer;
  case (var1,var2) of
    var1: (x,y : integer);
    var2: (p,q : real)
end
end

Suppose an array of 100 records was declared on a machine which uses 4 bytes for an integer and 8 bytes for a real. How much space would the compiler have to reserve for the array?

  1. A.

    2800

  2. B.

    2400

  3. C.

    2000

  4. D.

    1200

Attempted by 6 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…