A RetroSearch Logo

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

Search Query:

Showing content from https://arduinojson.org/v5/api/jsonarray/remove/ below:

JsonArray::remove() | ArduinoJson 5

Description

Removes the element at the specified index.

Signature
void remove(size_t index);
Arguments

index: the zero-based position of the element in the array.

Example
JsonArray& array = jsonBuffer.createArray();
array.add("A");
array.add("B");
array.add("C");
array.remove(1);
array.printTo(Serial);

will print the following string to the serial output:

Causes memory leaks

This function doesn’t free the memory allocated to the element in the JsonBuffer.

This is a conscious design decision made to keep the JsonBuffer fast and small, which is a fundamental principle of the library.

As a consequence, you cannot remove and add elements in a loop, otherwise the JsonBuffer will overflow.

Don’t try to keep the state of your application in a JsonArray, instead use custom structures.

See also
  1. Home
  2. Version 5
  3. API
  4. JsonArray
  5. remove()

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