title: Declaration or Definition
body: <p>I have a confusion about declaration and definition.</p>
  
  <p>In the statement</p>
  
  <pre><code>int switchon(float duration);
  </code></pre>
  
  <p>Q1. Is the parameter 'duration' being defined or is it being declared?</p>
  
  <p>As per section 3.1/2 of the holy Standard, it is a definition, but I am unable to understand why. </p>
  
  <p>Q2. What is the exact difference between declaration and definition?</p>
  
  <p>C++ In a Nutshell says that </p>
  
  <blockquote>
    <p>A definition defines the storage,
    value, body, or contents of a
    declaration. The difference between a
    declaration and a definition is that a
    declaration tells you an entity's name
    and the external view of the entity,
    such as an object's type or a
    function's parameters, and a
    definition provides the internal
    workings of the entity: the storage
    and initial value of an object, a
    function body, and so on.</p>
  </blockquote>
  
  <p>This definition of 'definition and declaration' also does not help me to understand why 'duration' is a definition and not a declaration in the statement above.</p>
  
  <p>REDIT:</p>
  
  <p>UncleO's post gave me an idea and this is what I tried:</p>
  
  <p>I changed my code as:</p>
  
  <pre><code>int switchon(float duration, int duration);   // idea is to see what error 
                                                // compiler gives
  
  int main()  {  }
  </code></pre>
  
  <blockquote>
    <p>error C2371: 'duration' :
    redefinition; different basic types</p>
  </blockquote>