Skip to content

Convert json list to C++ list #4329

Closed Answered by RPowell-C
RPowell-C asked this question in Q&A
Discussion options

You must be logged in to vote

I solved my own problem lol, I initialized a vector, and then read through the parsed (i think) json list and added it to the vector, here is the code for future people who may have this problem

std::vector<std::string> affected_files_array;
    int counter = 0;
    for (std::string x : data["affected_files"])
    {
        affected_files_array.push_back(x);
        counter++;

    }


Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by RPowell-C
Comment options

You must be logged in to vote
1 reply
@RPowell-C
Comment options

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