Die js-Tabelle zeigt, wie man in C++ schreibt.

Schriftsteller:Lunchzeit, Erstellt: 2017-12-19 22:49:29, Aktualisiert: 2017-12-22 15:24:49

var rows1 = new Array();
var rows2 = new Array();

var table1 = {
    type: 'table',
    title: '交易所信息',
    rows: rows1,
}
var table2 = {
    type: 'table',
    title: '交易所信息2',
    rows: rows2,
}
 var t_r = new Array();
t_r.push("okex");
rows1.push(t_r);
t_r.push("huobi");
rows1.push(t_r);

 var t_r2 = new Array();
t_r2.push("huobi");
rows2.push(t_r2);
t_r2.push("xxxxx");
rows2.push(t_r2);

table1.rows = rows1;
table2.rows = rows2;
LogStatus( '`' + JSON.stringify([table1, table2]) + '`');

Die js-Tabelle zeigt, wie man in C++ schreibt.


Mehr

LunchzeitDas ist gut, danke.

NullIch weiß. Void main ((() { json tbl = R"({"type" : "table", "title" : "AAA", "cols" : ["Head1", "Head2"], "rows": []}) "_json; Tbl ["rows"].push_back (({"111", "222"}); Tbl ["rows"].push_back (({"col2", "col22"}); LogStatus (("`"+tbl.dump (() + "`"); Wir sind hier. Ich weiß. Die mitgelieferte JSON-Bibliothek ist sehr leistungsstark und kann auf der Github-Dokumentation unter https://github.com/nlohmann/json eingesehen werden. Das ist eine sehr elegante Umsetzung.