When do employ "const" reference arguments in function?, C/C++ Programming

Assignment Help:

A:

1.      By using const protects you against programming errors which inadvertently alter data.

2.      By using const allows function to procedure const and non-const actual both arguments, whereas a function without const in the prototype can only accept non constant arguments.

3.      By using a const reference let the function to generate and employ a temporary variable appropriately.

 

 


Related Discussions:- When do employ "const" reference arguments in function?

#rotation, #write code for rotation in c

#write code for rotation in c

Change to palindrome, A palindrome is a string that reads the same from the...

A palindrome is a string that reads the same from the both the ends. Given a string S convert it to a palindrome by doing character replacement. Your takes is to convert S to palin

Draw a circle in c program , Draw a circle in c program: void main() ...

Draw a circle in c program: void main() { clrscr(); int i,r=50,t,j,x,y; int gd,gm; gd =DETECT; initgraph(&gd,&gm,""); for(x=50;x for(y=50;y {   i

Explain constructors, Constructors By definition, a constructor functio...

Constructors By definition, a constructor function of some class is a member function that automatically gets implemented whenever an instance of the class to which the constru

What is pointer arithmetic, Pointer Arithmetic We can manipulate the po...

Pointer Arithmetic We can manipulate the pointers too. We can perform operations such as addition, subtraction, increment and decrement etc.,. As the pointer variables have add

Merge sort, Write a program in C language to implement Two-Way Merge Sort. ...

Write a program in C language to implement Two-Way Merge Sort. Input the following data to the program. Show all intermediate steps: 84, 83, 78,90,23,123,98,159,8,200

C program for string operations, Aim: To implement a program for following...

Aim: To implement a program for following string operations: Length of String. String Concatenation. Substring (provide start index and length) Find character a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd