-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
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
Error Using JSON Library with arrays C++ #475
Comments
I just realized it may be because I am not allocating mem for the strings properly? string message[50]; // Messaged linked to user name through array index |
You usually only need to implement a {
mbMessage = {message}; // Store the array of strings here
{"NumUser", "NumMessage"},
{numUser, numMessage}
}; to I understand you want to store an array of strings. This is possible by code like json mbData;
mbData["messageBoard"] = {"foo", "bar", "baz"); I'm not sure if this helps you. Please let me know. |
You probably want to use |
Thanks for the responses. I do not think I will be able to store the strings as = { aaa, bbb } since they are inputted through both a file and interface. Unless this would work ? GUI Input & File Input-> saved as strings json mbData; I will know how many there are, but not what values they hold. If not I will try What do the > mean in this statement? |
You can use |
@JMcCASKI Did it work now? |
Hi,
I am using your json c++ libraryon a University project.
I am trying to create a json structure with an array of strings contained in it... along with some other information.
Whenever I try to add the array I get an error:
./json.hpp:843:9: error: static_assert failed "could not find to_json() method
I have not implemented to_json() method if that is required, though, I am unsure how to do sure with you library implementation.
My code is along the lines of:
where message is a string array each of char size 50 from the string.h lib.
Possibly you may know why this is happening ?
Thanks,
Josh McCaskill
The text was updated successfully, but these errors were encountered: