Object pointers

void function(A *objA); -> function call : function(*objA);

the function takes an object pointer. But when we call the function we pass the dereferenced pointer. Now passing the address is more efficient than passing the whole object copy. So tell me whether I have done it correct here.. thanks a lot for any valuable ideas on this.
The function call would be function(&objA);, but if you're dealing with C++, don't abuse pointers - pass by reference instead.
Okay Cubbi thanks for the comment. But what is the difference between C++ and C usage of pointers. As I know they look the same.

But since you have mentioned here specifically " but if you're dealing with C++, don't abuse pointers " it gives me a sense that I am wrong.

Please do tell me whats the difference.

And function (A* objA) is a function that takes an object pointer. So I see where I wrong, there is no need to pass the whole dereferenced object. Thanks Cubbi.
Topic archived. No new replies allowed.