Mysql c api row [0] to row
2 answers
The% s format should only accept char *, so from your description it looks like MYSQL_ROW is indeed char **, and string [0] will give char * anyway.
I don't see how using sprintf () (or the safer but non-standard asprintf ()) will do any good, but you can think about it if you feel better.
+1
source to share
You can use sprintf () , but you still need to know the length of the string contained in line [0] so that you can allocate enough memory.
Caveat: BCS correctly specifies that your data will be truncated if line [0] contains additional nul bytes. If you know how much data is stored in line [0], using memcpy () is probably the best solution.
0
source to share