Given the following declarations:
T obj;
void foo(T *);
Which options of a function call we use?
Explanation
T * in function declaration means pointer to the object of type T, that's why pointer (i.e. address of the variable) should be passed as a parameter. The & operator allows us to get the address, and foo(&obj) is a correct option therefore.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes