In header files whether functions are declared or defined?

2 replies [Last post]
dhanunjaya
Offline
Last seen: 9 years 33 weeks ago
Joined: 2009-04-26
bOt Points: 153

In header files whether functions are declared or defined?

preeti
Offline
Last seen: 10 years 14 weeks ago
Joined: 2009-03-30
bOt Points: 85
Functions are only declared

Functions are only declared in header files and not defined...

they are defined somewhere else, i dont knw where

 

can some one help?

codeguru
Offline
Last seen: 10 years 21 weeks ago
Joined: 2009-04-08
bOt Points: 114
for the functions provided by

for the functions provided by standard libraries

 

function declarations in header files (usually with .h extension) 

 

function definitions is usually provided in the form of pre-compiled code. You might check your copy of C/C++ which you are using. You would find files wih .o or .obj extension in the directory of your C/C++ install.

 

for defining your own header files , the common practice is to include the declaration in your header file and write separate program file which contains the function definition. Both these files should be available in the current path.