Consider the following code written in a pass-by-reference language like FORTRAN and these statements about the code.
it = ix
L1 : ix = iy
L2 : iy = it
ia = 3
ib = 8
call swap (ia, ib+5)
print *, ia, ib
S1: The compiler will generate code to allocate a temporary nameless cell, initialize it to 13, and pass the address of the cell to swap
S2: On execution the code will generate a runtime error on line L1
S3: On execution the code will generate a runtime error on line L2
S4: The program will print 13 and 8
S5: The program will print 13 and -2
Exactly the following set of statement(s) is correct:
@Arjun Sir || @Bikram Sir
is below its C equivalent code ?
As https://www.cs.fsu.edu/~myers/c++/notes/references.html states.
This is illegal at least for C++.
I even tried running the code in C++. It throws a compilation error.
@Shubhgupta could you pls help me
m not getting why we are considering second parameter as temp
@jk_1, because we are not passing address of ib we are passing ib+5 that will store in one temp location.