I know there are few question about const correctness where it is stated that the declaration of a function and its definition do not need to agree for value parameters. Thi
If there is const keyword present; it means value of 'i' (which is const type) can not be modified. If value of 'i' is changed inside foo function compiler will throw error: "
Can not modify const object
But changing '*i' (i.e. *i = 3;)means you are not changing value of 'i' but value of address pointed by 'i'
Actually,the const function is appropriate for large objects that should not be altered by function.