Skip to content

How to feed a predefined integer value into json string #2138

Closed
@augik

Description

int a,b,c,d;
a = 80;
b = 90;
std::string s = "{\"x_coordinate\": a, \"y_coordinate\" : b, \"width\": c, \"height\": d}";
json j = json::parse(s);

The above code gives me the below exception error:
case 4:
JSON_THROW(static_cast<const detail::out_of_range>(&ex));

Any kind of help to solve this problem would be highly appreciated.

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions