title: Lua 5.2 redirecting the print function
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4508119/redirecting-redefining-print-for-embedded-lua">Redirecting/redefining print() for embedded Lua</a>  </p>
  </blockquote>
  
  
  
  <p>I am new to Lua and rather confused.
  I have seen <a href="https://stackoverflow.com/questions/4508119/redirecting-redefining-print-for-embedded-lua">this</a> but Im not sure it works for 5.2.</p>
  
  <p>I have read about _ENV table(?) but again not sure if this has anything to do with it.</p>
  
  <p>So on to the question:
  How do I, in C/C++, redirect the in-built print function of Lua 5.2 to call my own C/C++ function?</p>