In the document of iconv, the function synopsis is this:
#include <iconv.h>
size_t iconv (iconv_t cd, const char* * inbuf,
size_t * inbytesleft,
char* * outbuf,
size_t * outbytesleft);
But, when I check the iconv.h
in my system, the function synopsis is this:
extern size_t iconv (iconv_t __cd, char **__restirct __inbuf,
size_t *__restrict __inbytesleft,
char **__restirct __outbuf,
size_t *__restrict __outbytesleft);
In these two function synopses, one is const char **, but the other one is only char **.
Why is the function synopsis in the document different from the one in my system? And why does the iconv function need a non-const inbuffer?
The version of my g++ is 6.3.0.