What is more efficient to pass as a parameter--a pointer or
an object? Why?
Answer / 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 |
What is a copy constructor? What is the need for it?
Is visual c++ the same as c++?
How will slove problem comes wirh Hybrid Inheritance?
What is splitter window in vc++?
What is the difference between Boxing and Unboxing in C#
How can we allow no selection of radio button in grouped radio buttons?
How can we use cmutex?
What is a microsoft visual c++ 2008 redistributable?
Is microsoft visual c++ a virus?
What is a mnemonic?
What is the Use of the Developer Studio Editor?
What is microsoft visual c++ 2005 redistributable?