Why it is said here that when passing an object to function it must be passes by reference ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why it is said here that when passing an object to function it must be passes by reference ?

Before this in composition we passed object directly then why not at here ?

24th Jul 2017, 4:57 PM
Amit Sharma
Amit Sharma - avatar
1 Answer
+ 2
It isn't necessary, you can pass it either by value or by reference
24th Jul 2017, 9:52 PM
Eligijus Silkartas
Eligijus Silkartas - avatar