我只有一小段代码需要解析

我只想要像

长名(简称),例如欧元(EUR)或英镑(GBP)

并以这种方式使用C++将其输出到file.txt中

欧元(EUR)
英镑(GBP)

{
        "shortname": "EUR",
        "longname": "Euro",
        "users":  "Austria,Belgium,Cyprus,Finland,Helsinki,France,Paris,Germany,Berlin,Greece,Athens,Ireland,Dublin,Italy,Rome,Milan,Pisa,Luxembourg,Malta,Netherlands,Portugal,Sl$
                "alternatives": "ewro,evro",
        "symbol": "€",
        "highlight": "1"
    },
    {
        "shortname": "GBP",
        "longname": "British Pound",
        "users":  "United Kingdom,UK,England,Britain,Great Britain,Northern Ireland,Wales,Scotland,UK,Isle of Man,Jersey,Guernsey,Tristan da Cunha,South Georgia and the South San$
        "alternatives": "Quid,Pound Sterling,Sterling,London,Cardiff,Edinburgh,Belfast",
        "symbol": "£",
        "highlight": "1"
    },

最佳答案

是JSON。您最好使用解析器。我建议你jsonCpp(link)

关于c++ - C++如何解析此字符串,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11646796/

10-11 18:08