We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create json object from string variable? i tried to create json object from string variable but doesn't work
json j = jsonStr_json
jsonStr is string variable which holds json string.
The text was updated successfully, but these errors were encountered:
User-defined literals only work with string literals:
json j = "[0, true]"_json;
Edit: What you need is json::parse(jsonStr)
json::parse(jsonStr)
Sorry, something went wrong.
_json only works with string literals. To create a JSON value from a string, you need to call the parse function:
_json
parse
json j = json::parse(jsonStr);
@sivapooja Does this solve your issue?
Yes, Thank you
No branches or pull requests
How to create json object from string variable? i tried to create json object from string variable but doesn't work
json j = jsonStr_json
jsonStr is string variable which holds json string.
The text was updated successfully, but these errors were encountered: