c++ - when to use const char * -
if have function api expects 14 digit input , returns 6 digit output. define input const char *. correct , safe thing do? why not want char * seems more prudent use const char * in case since api providing. different input values generate 6 digit codes.
when const char *c
telling compiler not making changes data c
points to. practice if not directly modifying input data.
Comments
Post a Comment