Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "json.h"
- #include <cstdio>
- int main() {
- char str[256];
- printf("Insert a json string\n> ");
- gets(str);
- json_parse_result res = json::parse(str);
- if (res.result()) {
- printf("Parsed: ");
- puts(res.result()->toString().c_str());
- } else {
- puts(str);
- int i = res.error_index();
- while (--i >= 0) {
- printf(" ");
- }
- printf("^ Syntax error\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement