mesh2005 -
Here's the story:
1. You need to allocate an input buffer (for example, "char inbuf[256]")
2. You pass iconv the address of the buffer.
NOT the buffer (not "iconv (cd, inbuf, ...)"), but the ADDRESS OF inbuf.
This is where the "**" syntax comes from.
3. The REASON for this is that iconv is going to CHANGE the start address as it processes the buffer, moving the pointer forward.
4. To make this work, you really need TWO variables:
a) One variable for the buffer itself ("inbuf")
b) A second variable for the current position in the buffer (for example "char *inchar")
The code would look something like this:
Code:
#define BUFSIZE 256
char inbuf[BUFSIZE];
char *inchar = inbuf;
int count = iconv(cd, &inchar, ...)
5. You also need to do the same thing for a corresponding "outbuf".
Here's some excellent documentation that should help:
http://en.wikipedia.org/wiki/Iconv
http://docs.hp.com/en/B2355-90130/iconv.3C.html