Object datatype on function's parameter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Object datatype on function's parameter

if we use int, float string...etc to request a value when calling a function. then what is it for an object?

6th May 2018, 4:56 AM
Eric Klod
Eric Klod - avatar
3 Answers
+ 3
Do you mean to pass an object as an argument to a function, or do you want to have a function to return an object (you mentioned "to request a value")
10th May 2018, 6:39 PM
Ipang
+ 2
I think it depends on how that function's parameter was defined, you can have it to accept an object, or an object pointer, if you want to pass the object you have the option whether to pass its reference, or make use of its copy. Hth, cmiiw
16th May 2018, 4:30 PM
Ipang
+ 1
pass an object as an argument.
16th May 2018, 12:09 PM
Eric Klod
Eric Klod - avatar