library functions

J

junky_fellow

what is the purpose of using library functions ?

How could i know whether a particular function that i want to
write already exists in the library ?

Are there some standard functions which ought to be taken by library ?

Can i write a portable code without using library functions ?

Can i write my own function and use it even if that function does exist in the
library ?

thanx for any help .....
 
E

Emmanuel Delahaye

junky_fellow wrote on 13/08/04 :
what is the purpose of using library functions ?

Avoiding to reinvent the wheel... In addition, the implementation can
be optimizied for the current target.
How could i know whether a particular function that i want to
write already exists in the library ?

Read this C-library reference (my .sig). It helps a lot.
Are there some standard functions which ought to be taken by library ?

See above.
Can i write a portable code without using library functions ?

Yes, but you will have no I/O (streams). Hard to do something useful in
these conditions.
Can i write my own function and use it even if that function does exist in
the library ?

Not recommended. Well some tricks exist (based on some evil macros...)

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"C is a sharp tool"
 
T

Tom St Denis

Emmanuel said:
Yes, but you will have no I/O (streams). Hard to do something useful in
these conditions.

That's interesting because I have a crypto and bignum library that don't
require standard C I/O to work. In fact they don't even need a standard C
library [though it defaults to using malloc/memset/etc you can change that
trivially via defines].

Sure you can't write a lot of end user applications without some form of I/O
you can write libraries ;-)

Tom
 
F

Flash Gordon

On 13 Aug 2004 05:06:05 -0700
what is the purpose of using library functions ?

Libraries are there to make life easier.
How could i know whether a particular function that i want to
write already exists in the library ?

Read a good book on C such as K&R2 (see the comp.lang.c FAQ which is
also a good reference work).
Are there some standard functions which ought to be taken by library ?

Not sure what you mean here.
Can i write a portable code without using library functions ?

Yes, but you won't be able to do much.
Can i write my own function and use it even if that function does
exist in the library ?

In general you can't re-use names of library functions for your own
identifiers.
 
O

osmium

junky_fellow said:
what is the purpose of using library functions ?

Note that the person who writes the library functions is entitled to use
assembly language for the actual platform.
How could i know whether a particular function that i want to
write already exists in the library ?

You just have to *know*. I think one of the best ways to learn is to pretend
you were assigned the job of teaching a well organized course on the
libraries. Make the notes you will need to teach the class. Note that no
one actually has to *read* the notes. You know, in your head, what you
meant.
Are there some standard functions which ought to be taken by library ?

I don't understand that question. Are there significant missing pieces?
Yes, I think so. But programmers seem to be able to make any discussion
into a religious argument.
Can i write a portable code without using library functions ?

FWIW I once had a low priced *commercial* compiler that came without any
libraries. A real PITA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
arinsharma
Top