A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arduinojson.org/v6/api/staticjsondocument/ below:

StaticJsonDocument | ArduinoJson 6

Description

StaticJsonDocument is a JsonDocument that allocates its memory pool in-place, so it doesn’t rely on dynamic memory allocation.

Because it doesn’t call malloc() and free(), StaticJsonDocument is slightly faster than DynamicJsonDocument.

If you declare a local variable of type StaticJsonDocument, it allocates the memory pool in the stack memory. Beware not to allocate a memory pool too large in the stack because it would cause a stack overflow. Use StaticJsonDocument for small documents (below 1KB) and switch to a DynamicJsonDocument if it’s too large to fit in the stack memory.

Member functions Example

Here is a program that deserializes a JSON document using a StaticJsonDocument

StaticJsonDocument<200> doc; // <- a little more than 200 bytes in the stack

char json[] = "{\"hello\":\"world\"}";
deserializeJson(doc, json);

const char* world = doc["hello"];
See also
  1. Home
  2. Version 6
  3. API
  4. JsonDocument
  5. StaticJsonDocument

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4