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
In which Way invoke context-sensitive help inside the editor?
What is visual c++ 2008 redistributable x64?
Where can I find microsoft visual c++?
Is visual c++ still used?
What is iunknown? Explain some of commonly used methods provided by iunknown.
What is microsoft visual c++ 2005 redistributable?
What is difference between c++ and vc++?
Explain the advantages of cwinthread class.
What is the Use of the Developer Studio Editor?
Explain the significance of initapplication() in vc++.
Do I need microsoft visual c++?
Do I need microsoft visual c++ 2005 redistributable on my computer?
Is it ok to uninstall microsoft visual c++?
How do I create an mfc application in vc++?
What is visual c++ runtime error?