#include "cppjson.h" int main() { // Create an empty JSON object JsonValue obj = JsonValue::object(); // Add a key-value pair to the object obj["name"] = "John Doe"; // Add an array to the object JsonValue arr = JsonValue::array(); arr.append("item1"); arr.append("item2"); obj["items"] = arr; // Print the JSON object std::cout << obj << std::endl; return 0; }In this example, we create an empty JSON object and add a key-value pair to it using the bracket operator. We also add an array to the object, and append two elements to the array using the `append` method. Finally, we print the JSON object to the console. We use the CppJSON library in this example.