title: Implementing a function which returns function definition as string
body: <p>I'm making a program in which a function, say <code>double f(double)</code>,  is defined.
  I want to create a function(or a macro) <code>codeToStr(f)</code> which will return a <code>std::string</code>/<code>const char*</code> containing definition of the function <code>f</code>.<br>
  I believe that by using preprocessing directive something can be done but I can't figure out how.<br>
  Is there a way to do this besides using file IO and reading from the source file?  </p>
  
  <p>==<br>
  Reason for the question:<br>
  My university gave me the assignment to implement the "Trapezoidal rule" for numerical integration and they've asked us to hard-code the function f(x). After I submit the code, they will modify that function from the source code to test various cases. I'd like my output to have a way of displaying the function definition of the function that is going to be integrated. This is the reason why I want to implement <code>codeToStr</code>.</p>