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
Is visual c++ a compiler?
What is the use of microsoft visual c++ 2015 redistributable?
What is a thread (VC++) and state the difference between Cmutex and Csemaphone?
Difference between getmessage, postmessage & peakmessage.
What is cwinthread class?
Do I need microsoft visual c++ on my computer?
What is difference between c++ and visual c++?
Can I uninstall visual c++ 2005?
In which Way invoke context-sensitive help inside the editor?
hello sir i need movie editing and mixing software .where it is available and what is the site address
Can I remove microsoft visual c++?
How do I get rid of microsoft visual c++ runtime library error?
Explain pointer to the constant and constant pointer?
What is ole? How do you handle drag and drop in ole?
Where can I find microsoft visual c++ on my computer?