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
Why static variable is used in c?
define string ?
What is wrong with this statement? Myname = 'robin';
What are 'near' and 'far' pointers?
Write a program that accept anumber in words
Describe the order of precedence with regards to operators in C.
What is auto keyword in c?
Subtract Two Number Without Using Subtraction Operator
Write a program to swap two numbers without using a temporary variable?
Why should I use standard library functions instead of writing my own?
Which is best book for data structures in c?
Does * p ++ increment p or what it points to?
What does c mean in standard form?
What is a pointer in c?
What is a substring in c?