Given the following code:
DCL (K, L) FIXED BIN (31) INIT (0);
DCL SUB ENTRY( FIXED BIN(31) BYADDR, FIXED BIN(31) )
OPTIONS(BYVALUE);
CALL SUB(K, L);
PUT(K, L);
and the following external procedure:
SUB: PROCEDURE(K, L) OPTIONS( BYVALUE );
DCL (K BYADDR, L) FIXED BIN(31);
K = 10;
L = 10;
END;
Which numbers are output by the PUT statement?
Which message will be displayed, if any, when the following code is executed with the Enterprise PL/I compiler using default compiler options?
DCL 1 STRUCTURE,
2 A CHAR(4),
2 P PTR;
STRUCTURE = ;
SELECT (P);
WHEN (NULL()) PUT LIST (P IS NULL);
WHEN (SYSNULL()) PUT LIST (P IS SYSNULL);
OTHERWISE PUT LIST (P is something else);
END;
In order to use a pointer to access the variable in the following program, with what storage class should Y be declared?
A: PROC OPTIONS(MAIN);
DCL X FIXED BIN(31) BASED;
DCL P POINTER;
P = FUNC();
PUT SKIP LIST( P->X );
FUNC: PROC RETURNS( POINTER );
DCL Y FIXED BIN(31) INIT(17);
DCL P POINTER;
P = ADDR(Y);
RETURN( P );
END;
END;