json::JSON arr = json::parse("[1, 2, 3, 4]"); int value = arr[2].get(); // get value at index 2 as int
JsonArray arr = JsonArray::parse("[5, 6, 7, 8]"); int value = arr.get_int(1); // get value at index 1 as intThis example is from the ArduinoJson library, which also includes a JsonArray class. Here, we again parse a JSON array and then get the integer stored at index 1 using the get_int() function. Package libraries: JSON for Modern C++, ArduinoJson