c - Correct sscanf() prototype, "int sscanf ( const char * s,const char * format, ...);" or int sscanf (char * s,const char * format, ...);? -
here prototype sscanf() function described in cplusplusreference(link) :
int sscanf ( const char * s, const char * format, ...); but find fishy it.not type of first argument differ many other string library functions strcpy()(1) , strcat()(2) (const char* vs char*),but seems odd how can make array pointed first argument constant when purpose of function write it(alter contents of array) using pointer!!
i mean, in int sscanf (const char * s,const char * format, ...); aren't telling through const qualifier can't change array pointed s using s? typo on site, or fail understand something?please explain.
const char * s
sscanf not write s string, s input string.
Comments
Post a Comment