NO

Author Topic: Functions  (Read 2104 times)

patsoks

  • Guest
Functions
« on: July 30, 2011, 02:05:51 AM »
Hello Every one,
I created a function to calculate leap years but dont know how to include it in my source files.
Help please? Anyone?

CommonTater

  • Guest
Re: Functions
« Reply #1 on: July 30, 2011, 02:45:58 AM »
You basically have 3 choices...

1) Copy and paste it into your source code.

2) Put it into a separate .c file and use an include (.h) to prototype it.

3) Create a static library (.lib) and use an include file to prototype it.

The first one should be obvious...  The second should be covered in any good C language textbook or tutorial and the third is probably impractical for a single function (libraries tend to be collections of functions).

If you post your source code showing the function and where you want to call it, we might be able to give you better advice...
« Last Edit: July 30, 2011, 02:47:48 AM by CommonTater »