If all your code is in one file, then declare the function definition near the top and the implementation down below:
/* include files */
#include "stdio.h"
/* function definitions */
int MultiplyByTwo(int iValue);
/* main function */
int main()
{
int iMyValue = 25;
int iNewValue = 0;
/* call your function */
iNewValue = MultiplyByTwo(iMyValue);
/* use the new value however you want */
printf("%i multiplied by two is %i\n", iMyValue, iNewValue);
}
/* your function implementation /*
int MultiplyByTwo(int iValue)
{
return (iValue * 2);
}
If your code is split into separate files, then create a header file (i.e. MyApplication.h) and put the function definition (but not the implementation) in that file. #include "MyApplication.h" at the top of your main .c file and in any other .c file that uses your function.