I have a confusion about declaration and definition.
In the statement
int switchon(float duration);
Q1. Is the parameter 'duration' being defined or is it being declared?
As per section 3.1/2 of the holy Standard, it is a definition, but I am unable to understand why.
Q2. What is the exact difference between declaration and definition?
C++ In a Nutshell says that
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.
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.
REDIT:
UncleO's post gave me an idea and this is what I tried:
I changed my code as:
int switchon(float duration, int duration); // idea is to see what error
// compiler gives
int main() { }
error C2371: 'duration' : redefinition; different basic types