Hi all
include<stdio.h> #define .... void xyz(); <---- i am referring to this defn of xyz() void abc() { -:statements:- } void main() { abc(); xyz(); } void xyz() { -:statements:- }
"A definition of a function may be provided by a prototype" Strictly, a Prototype provides only a declaration of a function; a matching definition must also be provided. A declaration simply informs the compiler about the function - it gives just enough information to allow the compiler to generate calls to the function, and handle any return value; ie, the function name, the number & type of any parameters, and the type of any return value. The definition provides the actual executable code to implement the function - the definition does not have to be in the same source file, or even the same language! The Linker sorts this out - or gives an "Unresolved External" error if it can't! As Graham said, you need to read-up on this in any standard 'C' textbook.
Thanks neil & graham