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
Where can I find microsoft visual c++?
In which Way invoke context-sensitive help inside the editor?
What is visual c++ 2008 redistributable x64?
What is splitter window in vc++?
Can I uninstall visual c++?
Where can I find microsoft visual c++ on my computer?
What is microsoft visual c++ 2015 redistributable?
What is iunknown? Explain some of commonly used methods provided by iunknown.
What is visual c++ 2010 redistributable package x64?
How do I reinstall microsoft visual c++?
Do I need microsoft visual c++?
What is difference between c++ and vc++?
What is vcredist?
How do I get rid of microsoft visual c++ runtime library error?
How do I uninstall and reinstall microsoft visual c++ runtime libraries?