Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++ constant function in class

Hello can someone please explain what does the const means in front of function declaration like so :

const void function(parameters);

I know, it means you can't modify what it returns, but how are we able to modify, what it returns? Thanks for any kind of reply.

like image 226
Jakkkub Avatar asked Jun 26 '26 08:06

Jakkkub


1 Answers

It means exactly nothing. The function does not return anything so the const modifier modifies nothing.

like image 155
eike Avatar answered Jun 27 '26 22:06

eike



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!