title: C macro returning type of variable
body: <p>Could it be possible to create a macro function whose returned value be one of the predefined c variable data types? Something like:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define IND_I_ 0
  #define IND_F_ 1
  #define INT_FORMAT_ "%i"
  #define FLOAT_FORMAT_ "%f"
  // (Of course the following macros do not make the desired jobs)
  // FORMAT_ macro would be used for the variable format:
  #define FORMAT_( ind_ )( (ind_) == IND_I_ ? FOR_INT_ : FOR_FLOAT_ )
  // VAR_TYPE_ macro would be used for 
  // defining variable types and for the casting of variables:
  #define VAR_TYPE_( ind_ ) ( (ind_) == IND_I_ ? int : float )
  
  int main( void )
  {
    VAR_TYPE_( IND_I_ ) first_var = 123; //here I want: int first_var = 123;
    VAR_TYPE_( IND_F_ ) second_var = 345.789;
    //Instead of:
    //printf( "int variable = " "%i" "\n", first_var );
    //I would use:
    printf( "int variable = " FORMAT_(IND_I_) "\n", first_var );
    printf( "float variable = " FORMAT_(IND_F_) "\n", second_var );
    printf( "truncated real variable = "  INT_FORMAT_ "\n", (VAR_TYPE_(IND_I_))second_var );
    return 0;
  }
  </code></pre>