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
What is visual c++ 2008 redistributable x64?
Explain the important features of vc++?
Do I need ms visual c++ on my computer?
Explain the advantages of cwinthread class.
What is microsoft visual c++ 2008 redistributable?
How do I uninstall and reinstall microsoft visual c++ runtime libraries?
What is a copy constructor? What is the need for it?
What is odbc in vc ++?
Is visual c++ still used?
Explain the significance of initapplication() in vc++.
What is vcredist_x86 exe?
What is the difference between turbo c++ and visual c++?
What is microsoft visual c++ 2010 x86 redistributable?
What is a wizard?
What is microsoft visual c++ 2013 redistributable package x64?