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

Name the three types of loops used in C++ programs?

4 Answers  


What is the difference between turbo c++ and visual c++?

0 Answers  


What is microsoft visual c++ runtime library error?

0 Answers  


How a dll will be sharable by more than one exe?

4 Answers   CA,


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

0 Answers  


What is the value of the expression a = 42?

2 Answers  


what is mean [] inc what is the use of include conio.h in c

1 Answers   BirlaSoft,


What is a glyph?

2 Answers  


Can I delete old microsoft visual c++?

0 Answers  


What is vc++ programming?

0 Answers  


What is cmutex? How can we use it?

0 Answers  


How do I reinstall visual c++ on windows 10?

0 Answers  


Categories