Can typeid() be used to pass a function?
<p>I tried this and got the output as:
void</p>

<p>Please explain the following Code:</p>

<pre><code>#include &lt;cstdio&gt;
#include &lt;typeinfo&gt;
using namespace std ;

void foo()
{    }

int main(void)
{
   printf("%s", 
     typeid(foo()).name());// Please notice this line, is it same as typeid( ).name() ?
   return 0;
}
</code></pre>

<p>AFAIK:
The typeid operator allows the type of an object to be determined at run time.</p>

<p>So, does this sample code tell us that <strong>a function that returns void is of *<em>type</strong> void</em>*.
I mean a function is a method and has no type. Correct?</p>
