Skip to content

How to get the object name? #1936

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions