when to use const char *

Posted by djones2010 on Stack Overflow See other posts from Stack Overflow or by djones2010
Published on 2010-04-30T14:21:24Z Indexed on 2010/04/30 14:27 UTC
Read the original article Hit count: 134

Filed under:

If i have a function api that expects a 14 digit input and returns a 6 digit output. I basically define the input as a const char *. would that be the correct and safe thing to do? also why would I not want to just do char * which I could but it seems more prudent to use const char * in that case especially since its an api that i am providing. so for different input values I generate 6 digit codes.

© Stack Overflow or respective owner

Related posts about c++