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
Differentiate between calloc and malloc.
What is adt in c programming?
What is the maximum length of an identifier?
Why c is known as a mother language?
Is c is a high level language?
What will the preprocessor do for a program?
What are the types of assignment statements?
Can you apply link and association interchangeably?
When the macros gets expanded?
How is = symbol different from == symbol in c programming?
How to set file pointer to beginning c?
Can you please explain the difference between syntax vs logical error?
How can you find the exact size of a data type in c?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
Is struct oop?