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 visual c++ used for?
What is the purpose of declaring a variable as unsigned?
How you build a project using Developer Studio?
What are some differences between a form view and a dialog box?
2 Answers DS Group, Manipal Ecommerce,
Where can I find microsoft visual c++?
Explain the important features of vc++?
How to create a DLL in C++.net 2005 which we can use in VB 6.0 application ?
Explain pointer to the constant and constant pointer?
What is the file extension used for C++ class implementation files?
Explain the significance of initapplication() in vc++.
What is a glyph?
What is more efficient to pass as a parameter--a pointer or an object? Why?