title: In C how is this parameter declared in the function?
body: <p>I am trying to learn the basics of C using <a href="http://en.wikipedia.org/wiki/The_C_Programming_Language" rel="nofollow">The C Programming Language - Brian Kernighan and Dennis Ritchie</a></p>
  
  <p>In the program below, I don't understand where the value for <code>'maxlineLength</code>' comes from?</p>
  
  <p>The for loop is set to run while '<code>i</code>' is smaller than <code>maxLineLength-1</code>, but what is the value of <code>maxLineLength</code> and where does it come from?</p>
  
  <p>From what I understand, when parameters are declared in a function like this a value is being passed to them, so they must surely be declared somewhere else to have the value passed in?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define MAXIMUMLINELENGTH 1000
  #define LONGLINE 20
  
  main() {
   int stringLength;
   char line[MAXIMUMLINELENGTH];
  
    while((stringLength = getLineLength(line, MAXIMUMLINELENGTH)) &gt; 0)
      if(stringLength &lt; LONGLINE){
    printf("The line was under the minimum length\n");
      }
      else if (stringLength &gt; LONGLINE){
          printf("%s", line);
      }
    return 0;
  }
  
  
  int getLineLength(char line[], int maxLineLength){
    int i, c;
  
    for(i = 0; i&lt; maxLineLength-1 &amp;&amp; ((c = getchar())!= EOF) &amp;&amp; c != '\n'; i++)
      line[i] = c;
  
    if(c == '\n') {
        line[i] = c;
        i++;
    }
  
    line[i] = '\0';
    return i;
  }
  </code></pre>