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.



How we add our function in liabrary as liabrary function. Exp. we want use our int factorical(int);..

Answer / 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

More C Interview Questions

main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*

1 Answers  


Can we assign integer value to char in c?

0 Answers  


what is the role you expect in software industry?

2 Answers   HCL, Wipro,


Why c is a procedural language?

0 Answers  


What is the main differences between C and Embedded C?

9 Answers  






What is the difference between Printf(..) and sprint(...) ?

0 Answers   InterGraph,


What are different storage class specifiers in c?

0 Answers  


44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?

3 Answers  


how can i get this by using for loop? * ** * **** * ******

3 Answers   Excel,


Explain how do you determine the length of a string value that was stored in a variable?

0 Answers  


Can you think of a way when a program crashed before reaching main? If yes how?

2 Answers  


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

0 Answers  


Categories