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

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.

 

 

Posted Date: 3/21/2013 7:27:44 AM | Location : United States







Related Discussions:- When do employ "const" reference arguments in function?, Assignment Help, Ask Question on When do employ "const" reference arguments in function?, Get Answer, Expert's Help, When do employ "const" reference arguments in function? Discussions

Write discussion on When do employ "const" reference arguments in function?
Your posts are moderated
Related Questions
write c program to do the following : -fill 2 dimensional array (square matrix array with size=4). -ask the user to enter any integer number and add this number to the diagonals -o


can you help with the assignment, I don''t want to upload the assignment but want somebody to work with, do you do that?

F r i e n dly Function: A class can have public members and private members.   The public member can be used through the class using dot operator.   Where as private me

C Program for REMOVING CHAR WHICH U WANT void main() {           int i,j;           char a[100],r;           clrscr();           for(i=0;i

2. a) Define a structure to store roll no, name and marks of a student. b) Using the structure of Q2. a), above write a ''C'' program to create a file "student.dat". There must be

2-D Array- C program: Define a two dimension array using c. void convert ( int a[10][10] , int[] , int , int); void main()   {   clrscr();   int a[10][10], b[10

Polymorphism C++ supports this idea - that different objects do "the right thing "- by function polymorphism and class polymorphism. Poly means many, while morph means form.

Control Flow The control flow statements are used when it is needed that the flow of the program is to be changed after taking some decision. This control flow statement theref

Develop Custom Mql4 Code/Fxdreema block Project Description: I need the subsequent code written in mql4 and integrated as custom block(s) in fxdreema: for each trade: C