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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -