Function Quiz — Asked in Interviews.

Placewit
1 min readMar 27, 2022

Can we use function on left side of an expression in C and C++?

A) Possible in C and C++.

B) Possible in C but not in C++.

C) Possible in C++ but not in c.

D) None of the above.

Solution: C is correct

In C++, only the functions which return some reference variables can be used on the left side of an expression. The reference works in a similar way to pointers, so whenever a function returns a reference, an implicit pointer is being returned to its return value. Therefore, through this, we can use a function on the left side of an assignment statement

Thanks for Reading

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.

Learn more at Placewit. Follow us on Instagram and Facebook for daily learning.

--

--