A RetroSearch Logo

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

Search Query:

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

JsonArray::operator[] | ArduinoJson 6

Description

JsonArray::operator[] gets or replaces a value in the array pointed by the JsonArray.

If the JsonArray is null, this operator does nothing.

If you need to know if the insertion succeed, use JsonVariant::set() instead.

Don’t use this operator to get all values; instead, use iterators.

Signatures
ElementProxy operator[](size_t index) const;
Argument

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

Return value

JsonArray::operator[] returns a proxy class that allows you to use the JsonArray as a C array.

If this concept of proxy class is unfamiliar to you, just think of a JsonVariant instead.

Example
JsonArray array = doc.to<JsonArray>();
array.add(42);
int value = array[0];
array[0] = 666;
See also
  1. Home
  2. Version 6
  3. API
  4. JsonArray
  5. operator[]

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