String literals vs const char* in C

前端 未结 5 1643
傲寒
傲寒 2020-12-09 20:25

Why don\'t ANSI C compilers flag the use of a string literal argument in a function call in which the correponding parameter does not have a const qualifier? For example,

5条回答
  •  借酒劲吻你
    2020-12-09 20:43

    What Hans Passant said. const was added as part of the ANSI standard on 1989, so anything from before that didn't have const.

提交回复
热议问题