title: Can You Explain This Void Pointer Inside Function Paramter?
body: <p>Here is the code in question! I have not spent too much time with C++, and I'm implementing a Binary Search Tree. </p>
  
  <pre><code>void BST::Preorder(void(*visit)(const Node *))
  </code></pre>
  
  <p>Later on the function is called like this:</p>
  
  <pre><code>bst.Preorder(PrintNode)
  </code></pre>
  
  <p>With PrintNode being implemented as follows:</p>
  
  <pre><code>void PrintNode(const Node* n)
  {
      cout &lt;&lt; n-&gt;GetValue() &lt;&lt; ",";
  }
  </code></pre>
  
  <p>Asked to implement this Preorder function-- but I am very confused as to what's going on here. Can anyone please point me in the proper direction. Thank you.</p>