Last active
August 29, 2015 14:10
-
-
Save RSquaredSoftware/2ac7767e199a101fa422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<int> authors; | |
void parser::findAuthors(std::string json, int startPos = 0, std::string searchKey){ | |
// Look for the key i.e. author, kind, data etc. | |
int key = json.substr(searchKey, startPos); | |
// If it was found | |
if (key > 0) { | |
// Add the location of the found author into the vector | |
authors.push_back(key); | |
// Print the location to share with the world | |
std::cout << key << std::endl; | |
// Recrusively do the same thing except starting after the current incident of the key | |
findAuthors(json, key + 1, searchKey); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment