title: Overloading a function with void
body: <p>Trying to overloading a function in C programming language with <code>_Generic</code>. Have found examples:</p>
  
  <ul>
  <li><a href="https://www.quora.com/Does-C-support-function-overloading" rel="nofollow noreferrer">https://www.quora.com/Does-C-support-function-overloading</a></li>
  <li><a href="https://stackoverflow.com/questions/479207/how-to-achieve-function-overloading-in-c">How to achieve function overloading in C?</a></li>
  </ul>
  
  <p>This the example:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  void display_float(float dispid) ;
  void display_int(int dispid) ;
  void display_void(void) ;
  
  #define display(x) _Generic((x), \
            float: display_float, \
            int: display_int,  \
            default: display_float  \
  )(x)
  
  void display_void(void){
      printf("display id: 0\n") ;
  }
  
  void display_float(float dispid){
     printf("display id: %f\n", dispid) ;
  }
  
  void display_int(int dispid){
      printf("display id: %d\n", dispid) ;
  }
  
  void main(void){
  
      display(5) ;
      display(6.5) ;
  }
  </code></pre>
  
  <p>Now I also want to overload the function with <code>display()</code>. Meaning the function would intake a <code>void</code>, call the function <code>display_void()</code>, and display 0. Can't seem to do this. Any help would be appreciated.</p>
  
  <p>EDIT 1:</p>
  
  <p>Also, see the examples <a href="http://www.robertgamble.net/2012/01/c11-generic-selections.html" rel="nofollow noreferrer">here</a>. One of the examples (I think) is passing a pointer to a void. Can this be implemented?</p>