Sir for your convenience I want to tell you what I did So that you can correct me........
Sir I am new to programming So I must have done several several mistakes so please don't get annoyed...You may scold me but do correct me.
1. First of all I wrote a function to calculate factorial of a number as :
int fact(int num)
{
int i,f=1;
for(i=1;i<=num;i++)
f=f*i;
return(f);
}
2. Then I build it and a file fact.obj was created. Using this file I created a library file "fact.lib". I saved this file in pelles C library itself.
3. Then I created a header file as :
#ifndef fact_file
#define fact_file
int fact(int);
#endif
4. Then I saved that file with '.h' extension in the 'include' folder of pellesC in program files in c drive.
5. Then to use that function , I wrote a program as :
#include<stdio.h>
#include<fact.h>
int main()
{
int a,b;
a=6;
b=fact(a);
printf("%d",b);
}
6. Since the location of header file is standard I didnt use these quotes " ".Instead I used < >.
7. Then I selected project options>linker and there i included fact.lib .
8. Now If I build the program it gives the error as I told you earlier.