title: Is declaration of variables expensive?
body: <p>While coding in C, I came across the below situation.</p>
  
  <pre><code>int function ()
  {
    if (!somecondition) return false;
  
    internalStructure  *str1;
    internalStructure *str2;
    char *dataPointer;
    float xyz;
  
    /* do something here with the above local variables */    
  }
  </code></pre>
  
  <p>Considering the <code>if</code> statement in the above code can return from the function, I can declare the variables in two places. </p>
  
  <ol>
  <li>Before the <code>if</code> statement.</li>
  <li>After the <code>if</code> statement. </li>
  </ol>
  
  <p>As a programmer, I would think to keep the variable declaration after <code>if</code> Statement. </p>
  
  <p><strong>Does the declaration place cost something? Or is there some other reason to prefer one way over the other?</strong></p>