T
Tom Impelluso
Hello,
This is a question about CATEGORIES of functions in C.
There are some C functions that require both a header and a library link:
exp(), sin(): #include<math.h> and -lm
There are some C functions that require JUST a header: malloc(),
fprintf(): #include<stdlib> or stdio.h
There are some C functions that require neither printf()
(actually, printf technically requires the #include, but if I do
not exploit the return value, I do not have to include it to
prototype the function)
Could someone tell me if these functions fall into NAMED categories?
Why was the language created so that there is this apparent asymmetry
in the use of functions: with regard to when to link a library
and when to include?
I understand the NEED to include headers... and libraries... But I am
only searching for why there is this apparent lack of balance....
i.e: What are the categories of these functions in C?
And, as a further example, there is the sleep(); function.
What TYPE of function is that (I know what it does, but why is
there no include and no library at all?)
thanks
t.
This is a question about CATEGORIES of functions in C.
There are some C functions that require both a header and a library link:
exp(), sin(): #include<math.h> and -lm
There are some C functions that require JUST a header: malloc(),
fprintf(): #include<stdlib> or stdio.h
There are some C functions that require neither printf()
(actually, printf technically requires the #include, but if I do
not exploit the return value, I do not have to include it to
prototype the function)
Could someone tell me if these functions fall into NAMED categories?
Why was the language created so that there is this apparent asymmetry
in the use of functions: with regard to when to link a library
and when to include?
I understand the NEED to include headers... and libraries... But I am
only searching for why there is this apparent lack of balance....
i.e: What are the categories of these functions in C?
And, as a further example, there is the sleep(); function.
What TYPE of function is that (I know what it does, but why is
there no include and no library at all?)
thanks
t.