C语言
noyoghurt
找到山头搬砖盖碉堡挖水沟
展开
-
掉入C语言的泥淖
offsetof #include <stddef.h> size_t offsetof(type, member);The macro offsetof() returns the offset of the field member from the start of the structure type. struct s { int i; ...原创 2020-02-06 22:38:30 · 96 阅读 · 0 评论 -
C语言操作sqlite3数据库注意SQL语言中字符串的处理
使用C语言往数据库中插入一个记录,发现无论如何都无法插入。数据库的创建语法 int rc = sqlite3_exec(db, "create table if not exists \ Account_Blob(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\ content BLOB, accountId TEXT NOT...原创 2019-03-16 21:14:18 · 711 阅读 · 0 评论 -
C scanf 的使用注意
scanf函数,给数值型数组赋值时只能用 for 循环一个一个地赋值,给字符型数组赋值可以整体赋值输入字符型数据时,系统会自动在最后添加结束标志符 ‘\0’系统会将空格,作为输入字符之间的分隔符例如,通过scanf读入一个数值型数组: int n = 0; int *a = NULL; while (n < 1) { print...原创 2019-03-24 20:51:00 · 242 阅读 · 0 评论