Const variable changed with pointer in C

const is a compile-time feature.
It doesn’t prevent you from shooting yourself in the foot; that’s what the warning is for.

Leave a Comment