push_back.cpp
Go to the documentation of this file.
00001 #include <json.hpp>
00002 
00003 using json = nlohmann::json;
00004 
00005 int main()
00006 {
00007     // create JSON values
00008     json array = {1, 2, 3, 4, 5};
00009     json null;
00010 
00011     // print values
00012     std::cout << array << '\n';
00013     std::cout << null << '\n';
00014 
00015     // add values
00016     array.push_back(6);
00017     array += 7;
00018     null += "first";
00019     null += "second";
00020 
00021     // print values
00022     std::cout << array << '\n';
00023     std::cout << null << '\n';
00024 }


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:06