A RetroSearch Logo

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

Search Query:

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

JsonArray::add() | ArduinoJson 5

Description

Adds a value to the JsonArray.

Signatures
bool add(bool value);
bool add(float value);
bool add(double value);
bool add(signed char value);
bool add(signed long value);
bool add(signed int value);
bool add(signed short value);
bool add(unsigned char value);
bool add(unsigned long value);
bool add(unsigned int value);
bool add(unsigned short value);
bool add(const char *value);
bool add(char *value); // see Remarks
bool add(const String &value); // see Remarks
bool add(const std::string &value); // see Remarks
bool add(const __FlashStringHelper *value); // see Remarks
bool add(JsonArray &array);
bool add(JsonObject &object);
bool add(const JsonVariant &variant);
Arguments

value: the value to add to the array.

Return value

true if the value was successfully added.

false if there was not enough memory in the JsonBuffer.

ArduinoJson makes a copy of the string when you call this function with one of the following types:

This duplication causes the JsonBuffer to grow. The memory allocated for the copy will only be freed when the whole JsonBuffer is discarded.

Note that the rules changed in version 5.13.

Example
StaticJsonBuffer<200> jsonBuffer;
JsonArray& array = jsonBuffer.createArray();
array.add("hello");
array.add(3.14156);
array.printTo(Serial);

will write

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

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