printf, writeln, writefln
H. S. Teoh
hsteoh at qfbox.info
Tue Dec 6 23:41:09 UTC 2022
On Tue, Dec 06, 2022 at 11:07:32PM +0000, johannes via Digitalmars-d-learn wrote:
> //-- the result should be f.i. "the sun is shining"
> //-- sqlite3_column_text returns a constant char* a \0 delimited c-string
> printf("%s\n",sqlite3_column_text(res, i));
> writeln(sqlite3_column_text(res, i));
[...]
In D, strings are not the same as char*. You should use
std.conv.fromStringZ to convert the C char* to a D string.
T
--
For every argument for something, there is always an equal and opposite argument against it. Debates don't give answers, only wounded or inflated egos.
More information about the Digitalmars-d-learn
mailing list