What is more efficient to pass as a parameter--a pointer or
an object? Why?



What is more efficient to pass as a parameter--a pointer or an object? Why?..

Answer / amar

Passing a parameter by pointer is more efficient than
passing as object. When a parameter is passed as object
another of copy of the object is created on stack hence it
has two overheads, 1. it takes cpu cycle while creating
copy object 2. it takes memory on stack.

Passing the parameter through pointer could lead to a
situation where function can acciedently change the value
of the object.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More VC++ AllOther Interview Questions

What is vcredist_x86 exe?

0 Answers  


What is microsoft visual c++ 2008 redistributable?

0 Answers  


What is microsoft visual c++ 2013 redistributable?

0 Answers  


How can we allow no selection of radio button in grouped radio buttons?

2 Answers  


How to Use mfc71d.dll not mfc71.dll ?

1 Answers  






How to declare more than one variable on a single line?

3 Answers   CMC,


What is a transparent image?

1 Answers  


What is microsoft visual c++ redistributable and do I need it?

0 Answers  


Can I uninstall visual c++ 2005?

0 Answers  


What is a wizard?

0 Answers  


Difference between getmessage, postmessage & peakmessage.

0 Answers  


What are some differences between a form view and a dialog box?

2 Answers   DS Group, Manipal Ecommerce,


Categories