Skip to content

How to get the object name? #1936

@3038922

Description

@3038922
const json userData = {
    {
        "intake",
        {
            {"motor", {
                         {"L", {{"port", 9}, {"test", false}, {"gear", 0}}},
                         {"R", {{"port", 10}, {"test", true}, {"gear", 0}}},
                     }},
            {"ADI", {
                        {"port", 4},
                    }},
            {"pragma", {
                         {"val1", 2600},
                         {"val2", 40},
                         {"val3", 5},
                     }},
        },
    },
};
auto temp=userData ["intake"];
std::cout<<temp.????<<std::endl;

I hope he can output 'intake'.
Which function should I use to get the name of the object name?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions