-
Hi! I'm doing a university assignment regarding graphs and I'm trying to parse a json file containing several key/value structures using a class called Parser. Just to be clear, I have to do this using said class:
At first it's pretty much straight forward, with the constructor and the readJSON() method:
I've already verified that I'm opening the file correctly. This json file contains several key/value structures, like this:
I'm getting this error:
I understand why I'm getting this error message, but I don't know how to solve it. I have to keep each structure separated, since each airport is going to be a node, but it won't let me put braces directly after the opening braces, and if I take out the opening and closing braces of the whole file, it stops reading after the first "}". What could I do? Is there even a way I could parse this file as a nlohmann::json object? Or does anyone have any ideas? :( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Just in case anyone needs it, I found a solution:
I replaced the global curly braces for square brackets in the json file, and managed to make it work this way. |
Beta Was this translation helpful? Give feedback.
Just in case anyone needs it, I found a solution:
I replaced the global curly braces for square brackets in the json file, and managed to make it work this way.