Hi guys, as always, trying to figure out a recursive function just hurts my brain. The function below works perfectly but I am a bit confused by line 13 and 14. If a recursive function calls itself inside a loop, what happens to the value of "i", does it ever get incremented. Lets take the code below as an example, lets assume the "length" of the vector "children" is 5, on the first iteration, the function calls itself and then what happens to the other 4 subsequent iterations of the loop. I hope my question is clear.

Qt Code:
  1. void Html_Parser::tableData(GumboNode *node)
  2. {
  3. if (node->type != GUMBO_NODE_ELEMENT) {
  4. return;
  5. }
  6. GumboAttribute* href;
  7. if (node->v.element.tag == GUMBO_TAG_A &&
  8. (href = gumbo_get_attribute(&node->v.element.attributes, "href"))) {
  9. std::cout << href->value << std::endl;
  10. }
  11.  
  12. GumboVector* children = &node->v.element.children;
  13. for (unsigned int i = 0; i < children->length; ++i) {
  14. tableData(static_cast<GumboNode*>(children->data[i]));
  15. }
  16. }
To copy to clipboard, switch view to plain text mode