is const (c++) optional?

前端 未结 11 651
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-11 21:06

according to some tutorials i read a while back, the \"const\" declaration makes a variable \"constant\" ie it cannot change later.
But i find this con

11条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 21:29

    You can forget about it but isn't it nice if the compiler forces it upon you? That way, your "const" variables actually stay constant.

提交回复
热议问题