+ 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?
3 Réponses
+ 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")
+ 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
+ 1
pass an object as an argument.