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 DLL?

7 Answers   Zenith,


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

3 Answers   CMC,


What is dao in vc ++?

0 Answers  


What is vcredist?

0 Answers  


What is microsoft visual c++ used for?

0 Answers  






I have to DLL one is COM dll and another is normal DLL. How I can identify which dll is normal DLL and which DLL is from COM DLL. please give me some clear picture on these

2 Answers  


What is difference between c++ and vc++?

0 Answers  


Difference between critical section, mutex and semaphore.

0 Answers  


What is cmutex?

0 Answers  


Name some examples of the different types of windows found in a Windows application?

4 Answers  


What is cwinthread class? Explain its advantages.

0 Answers  


What is visual c++ runtime error?

0 Answers  


Categories