A RetroSearch Logo

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

Search Query:

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

JsonArray::copyFrom() | ArduinoJson 5

Description

Populates the JsonArray with values from a C array.

Signatures
// 1D arrays
JsonArray::copyFrom(T array[len]);
JsonArray::copyFrom(T* array, size_t len);

// 2D arrays
JsonArray::copyFrom(T array[][]);
Arguments

array: an array of value of type T.

len: the number of elements in the array.

T: the type of the value, can be any type supported by ArduinoJson.

Return value

true if the operation is successful; or false if there was not enough room in the JsonBuffer.

Example
int values[] = {1, 2, 3};

StaticJsonBuffer<200> jsonBuffer;
JsonArray& array = jsonBuffer.createArray();
array.copyFrom(values);
array.printTo(Serial);

will write

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

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