Explain "const" reference arguments in function?



Explain "const" reference arguments in function?..

Answer / Parmeshwar Oraon

A const reference is a reference variable that refers to a constant object. It provides an efficient way of passing large objects as arguments to functions, without the need to create a copy of the object. The advantage of using const references over regular references is that they prevent accidental modification of the original object by the function.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Why is c++ still popular?

1 Answers  


Do we have to use initialization list in spite of the assignment in constructors?

1 Answers  


What is setw manipulator in c++?

1 Answers  


Differentiate between an array and a list?

1 Answers  


How to create a pure virtual function?

1 Answers  


You're given an array containing both positive and negative integers and required to find the sub-array with the largest sum (O(N) a la KBL). Write a routine in C for the above.

4 Answers  


Write bites in Turbo c++ Header ("Include") Files.

1 Answers  


What is c++ manipulator?

1 Answers  


How to implement is-a and has-a class relationships?

1 Answers  


What is the use of c++ programming language in real life?

1 Answers  


What is a type library?

1 Answers  


write a program that takes two numbers from user that prints the smallest number

2 Answers  


Categories