使用JSON数据 [英] Using JSON data
问题描述
我试图做一个简单的Twitter客户端在C.我是新这个,不知道如何去从JSON字符串,我从API获取有意义的隔离材料。
I am trying to make a simple twitter client in C. I'm new at this and not sure how to go about segregating meaningful stuff from the JSON string that I get from the API.
例如,如果我得到这从API的响应,我该怎么办解压出来的文本转换成字符串(字符*)的价值?我想我可以在较低的水平字符串的工作,但不会是过于繁琐,每次我需要从JSON字符串的值?
For example, if I get this as a response from the API, how do I extract out the value of "text" into a string (char*)? I guess I can work with the string at low level, but wouldn't that become too tedious every time I need to get a value from the JSON string?
推荐答案
有关JSON一般来说, json.org 有一吨不同的语言解析器实现了大名单。
For JSON in general, json.org has a big list of parsers implemented in a ton of different languages.
有关C:
- JSON_checker
- JSON parser
- json-c
- M's JSON parser
- YAJL
- cJSON
- Jansson
- jsmn
这篇关于使用JSON数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!