When we define functions in a program, do they get stored in the standard library?

694 views Asked by At

Since there are two types of functions; Library functions and user-defined functions....when we define a function in a program, does that function get stored in the standard library just like the library functions?

3

There are 3 answers

0
Sourav Ghosh On

When we define a function , it is not itself added to any library or object file. YOU need to create the object file [user functions] or library [static/dynamic] yourself. So. there is no concept of get stored as you asked. It entirely depends on what you are doing with your source code.

  • If you are creating a library, YES, it will be a part of the library.
  • If you are compiling to create an individual object file, NO, it will not be a part of any library.
0
Jens On

No. User-defined functions are stored in the object file created by compiling. These are linked with the libraries containing C standard library functions to form an executable binary.

0
srikanta mondal On

Library functions are previously written and stored functions which we can use by calling them.
While user defined functions are written by the programmers based on their requirements, to use these functions first we have to define it and then we have to call it.
And when you define a function those are not going to be getting saved in standard library.