Updated FAQ (markdown)

Benoît Blanchon
2015-11-18 14:00:22 +01:00
parent 7e5c368cb9
commit d31b05b82d

18
FAQ.md

@@ -14,6 +14,24 @@ If you're is case 2., you can solve the problem by increasing the size of the `S
If you're in case 3., you may have a memory leak, it up to you to find it. You can try to switch to `StaticJsonBuffer` which is more efficient.
Also, if the input string is constant, the `JsonBuffer` will have to make a copy of it.
```c++
// case 1: char array => no duplication => good
char[] json = "{\"hello\":\"world\"}";
jsonBuffer.parseObject(json);
// case 2: const char* => duplication => bad
const char* json = "{\"hello\":\"world\"}";
jsonBuffer.parseObject(json);
// case 3: String => duplication => bad
String json = "{\"hello\":\"world\"}";
jsonBuffer.parseObject(json);
```
To avoid any duplication, make sure you use an input of type `char*` or `char[]`
### The first parsing succeeds, why does the next ones fail?
This can be due to two causes.