How we add our function in liabrary as liabrary function.
Exp. we want use our int factorical(int); function as int
pow(int,int); function working in math header file.
Answer Posted / ataraxic
First, implement factorial in standalone module
(factorial.c for example).
Then complie it, create an archive and link it with our
program (my.c for example):
Compilation
1. gcc -c factorial.c -o factorial.o
Archiving
2. ar -rcsv libmy.a factorial.o
Compile our prog with new lib
3. gcc my.c -L. -lmy -lm -o my
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What does void main () mean?
What is the difference between fread and fwrite function?
What is a nested loop?
Is int a keyword in c?
What is bubble sort technique in c?
What is the use of pragma in embedded c?
What is use of pointer?
What is uint8 in c?
Why enum is used in c?
What are the characteristics of arrays in c?
What is the use of getchar() function?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
What are the parts of c program?
What is a null pointer in c?
Differentiate between #include<...> and #include '...'