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
How would you obtain the current time and difference between two times?
Can a pointer be volatile in c?
What do you mean by c what are the main characteristics of c language?
Is c programming hard?
Explain #pragma statements.
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
How do you do dynamic memory allocation in C applications?
What does the message "automatic aggregate intialization is an ansi feature" mean?
What is ctrl c called?
Why void main is used in c?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
What is structure data type in c?
What is function in c with example?
What is the difference between memcpy and memmove?
Is c easy to learn?