Can someone tell me the difference between the declaration of these two fuctions in a class? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone tell me the difference between the declaration of these two fuctions in a class?

int function() const; const int function(); What difference does const make if it's a get function? When there is only one{ return variable;} line in the function?

23rd Apr 2021, 7:20 AM
Mihail
Mihail - avatar
3 Answers
23rd Apr 2021, 7:46 AM
Rohit
23rd Apr 2021, 10:43 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
0
thanks
23rd Apr 2021, 10:42 AM
Mihail
Mihail - avatar