Merge pull request #274 from pah/fixes/273
tutorial.cpp: fix insitu parsing (closes #273)
This commit is contained in:
commit
362221d3ca
@ -24,12 +24,10 @@ int main(int, char*[]) {
|
|||||||
return 1;
|
return 1;
|
||||||
#else
|
#else
|
||||||
// In-situ parsing, decode strings directly in the source string. Source must be string.
|
// In-situ parsing, decode strings directly in the source string. Source must be string.
|
||||||
{
|
|
||||||
char buffer[sizeof(json)];
|
char buffer[sizeof(json)];
|
||||||
memcpy(buffer, json, sizeof(json));
|
memcpy(buffer, json, sizeof(json));
|
||||||
if (document.ParseInsitu(buffer).HasParseError())
|
if (document.ParseInsitu(buffer).HasParseError())
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("\nParsing to document succeeded.\n");
|
printf("\nParsing to document succeeded.\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user