json_object_object_foreach遍历json的宏定义实现
程序员文章站
2024-02-26 11:10:46
...
# define json_object_object_foreach(obj,key,val) \
char *key; struct json_object *val; \
for(struct lh_entry *entry = json_object_get_object(obj)->head; ({ if(entry) { key = (char*)entry->k; val = (struct json_object*)entry->v; } ; entry; }); entry = entry->next )
上一篇: 将文件名中的空格替换,重命名
下一篇: leetcode最后一个单词长度