In header files whether functions are declared or defined?

Showing Answers 1 - 6 of 6 Answers

s.annalakshmi

  • Sep 1st, 2005
 

header files are declared

  Was this answer useful?  Yes

Yashwant Pinge

  • Apr 27th, 2006
 

It depends on the user that creats the header files.Mostly headers file contains other file declaration and function declaration.Note that declaration and defination of functions are two different things

  Was this answer useful?  Yes

Silvio

  • Jul 4th, 2008
 

It is possible to declare and define body functions in header files, there is no restrictions to create your all code inside a header file.


SourceCode.c:
#include "SourceCode.h"


SourceCode.h:
#include <stdio.h>
#include <conio.h>


int Calc(int p_iNum1, int p_iNum2);


int main()
{
     printf("Hi there! 1 + 1 = %d",Calc(1,1));

     getch();


     return 0;
}


int Calc(int p_iNum1, int p_iNum2)
{
     return p_iNum1 + p_iNum2;
}


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions