Skip to content

How to access multiple keys together from a json file #2252

Answered by nlohmann
MdAnayat asked this question in Q&A
Discussion options

You must be logged in to vote

You do not need to loop at all. You can use this:

x = std::stoi(j["roi_x"].get_ref<const std::string&>());
std::cout << "The received x_coordinate value: " << x << std::endl;

y = std::stoi(j["roi_y"].get_ref<const std::string&>());
std::cout << "The received y_coordinate value: " << y << std::endl;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MdAnayat
Comment options

Answer selected by MdAnayat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants