c - 从 sqlite3_column_blob() 方法获取的指针是否需要删除?

标签 c sqlite

像这样:const void * test = sqlite3_column_blob(stat, 1); 我可以删除或删除[]测试吗?

最佳答案

来自sqllite documentation :

The pointers returned are valid until a type conversion occurs or until sqlite3_step() or sqlite3_reset() or sqlite3_finalize() is called. The memory space used to hold strings and BLOBs is freed automatically. Do not pass the pointers returned by sqlite3_column_blob() into sqlite3_free().

关于c - 从 sqlite3_column_blob() 方法获取的指针是否需要删除?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/325158/

相关文章:

sqlite - Xamarin Android 如何检索设备数据库

C 相邻堆栈寻址

c - 为什么从控制台读取字符并存储在数组中时出现段错误?

c - libpcap 捕获的信标帧有些奇怪

linux - Jupyter 缺少 _sqlite3 和 pysqlite2

java - 大小为 1 的 CursorIndexOutOfBoundException : Index 1 requested,

c - 单读单写固定大小的ringbuf,没有锁和原子变量,对于任何CPU架构来说总是安全的吗?

C - 将 char 指针传递给函数的段错误

.net - LINQ+轻量级数据库 : which db should I choose?

iphone - 如何在iphone的sqlite数据库中保存用户名和密码