GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

function as a const

 void fun() const { LINE 1

     return;

   }

what is the meaning of LINE 1 and when it is used in code

asked Oct 16, 2016 by bambhole
Nice question.I will give u some inf

1 Answer

Like as for variables,constant is also used for functions.We know if we declare any member variable or memver function as constant we cant modify them.We have to use them for just accessing.We can use this const where we need not to change the data at any time but only use for accessing.I hope u can understand.
answered Nov 28, 2016 by Yashu guntur
...