Liste des Groupes | Revenir à cl c |
In 20/20 hindsight, my personal opinion is that it would have beenAgreed.
better to make string literals const in C89/C90. Compilers could
still accept old const-incorrect code with a non-fatal warning,
and programmers would be encouraged but not immediately forced to
use const.
This could still be done in C2y, but I'm not aware of any proposals.There is always going to be some hassle with things like search functions - 100% const correctness is not easy when you don't have overloads. (It's not always easy even in C++ where you /do/ have overloads and templates.)
Les messages affichés proviennent d'usenet.