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 is oops c?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
Is python a c language?
Why do we use c for the speed of light?
What is meant by gets in c?
What is the Purpose of 'extern' keyword in a function declaration?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What does %d do in c?
What does double pointer mean in c?
What are the different types of control structures in programming?
What does p mean in physics?
How can I ensure that integer arithmetic doesnt overflow?
What is string concatenation in c?
What are the 4 types of functions?
What does the error 'Null Pointer Assignment' mean and what causes this error?