What is more efficient to pass as a parameter--a pointer or
an object? Why?
Answer Posted / 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 View All Answers
Explain some of commonly used methods provided by iunknown.
Do I need microsoft visual c++ 2005 redistributable on my computer?
What is a microsoft visual c++ 2008 redistributable?
Is microsoft visual c++ a virus?
What is visual c++ runtime error?
What is vc++ redistributable?
What is a thread (VC++) and state the difference between Cmutex and Csemaphone?
What is microsoft visual c++ redistributable and do I need it?
What is the difference between turbo c++ and visual c++?
How do I reinstall microsoft visual c++?
What is microsoft visual c++ 2013 redistributable?
Do I need microsoft visual c++ on my computer?
Explain the significance of initapplication() in vc++.
Explain pointer to the constant and constant pointer?
Difference between getmessage, postmessage & peakmessage.