【发布时间】:2009-11-17 00:07:02
【问题描述】:
我想使用类似于 printf 在 C 中所做的事情来存储格式化字符串。
char *tmp = (char *)sqlite3_column_text(selectstmt, 2);
const char *sqlAnswers = printf("select key from answer WHERE key = %s LIMIT 5;", tmp);
后者显然是个错误。
【问题讨论】:
-
最好是绑定参数的原因之一
标签: c string string-formatting