title: How to give one function the scope of another without nested functions in C?
body: <p>In Python:</p>
  
  <pre><code>#!/usr/bin/python
  
  def f1(a, b, c, d):
      return a + b + c + d
  
  x = 5;
  y = 6;
  z = 7;
  
  fm = lambda m: f1(m,x,y,z)
  print fm(4)
  </code></pre>
  
  <p>In Matlab:</p>
  
  <pre><code>function [retval] = f1(a, b, c, d)
      retval = a + b + c + d;
  
  x = 5;
  y = 6;
  z = 7;
  
  fm = @(m) f1(m,x,y,z);
  fm(4)
  </code></pre>
  
  <p>I know there are no nested functions in C without using the gcc extension. How do I get the same functionality in C as using nested functions? How do I declare variables and use them as constants in another function like in the examples?</p>