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 the difference between turbo c++ and visual c++?
What is cmutex?
Do I need microsoft visual c++?
What is dao in vc ++?
Do I need ms visual c++ on my computer?
What is microsoft visual c++ used for?
How do I get rid of microsoft visual c++ runtime library error?
What is ole? How do you handle drag and drop in ole?
What is visual c++ 2010 redistributable package x64?
Where can I find microsoft visual c++ on my computer?
What is cmutex? How can we use it?
What is microsoft visual c++ 2008 redistributable?
Does visual c++ 2017 replace 2015?
How do I uninstall vc++ 2015?
Explain the significance of initapplication() in vc++.