Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > library functions

Reply
Thread Tools

library functions

 
 
junky_fellow
Guest
Posts: n/a
 
      08-13-2004
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 .....
 
Reply With Quote
 
 
 
 
Emmanuel Delahaye
Guest
Posts: n/a
 
      08-13-2004
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"

 
Reply With Quote
 
 
 
 
Tom St Denis
Guest
Posts: n/a
 
      08-13-2004
Emmanuel Delahaye wrote:
>> 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.


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
 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      08-13-2004
On 13 Aug 2004 05:06:05 -0700
(junky_fellow) wrote:

> 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.
--
Flash Gordon
Sometimes I think shooting would be far too good for some people.
Although my email address says spam, it is real and I read it.
 
Reply With Quote
 
osmium
Guest
Posts: n/a
 
      08-13-2004
junky_fellow writes:

> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shared functions vs Non-Shared Functions tshad ASP .Net 11 05-27-2005 05:53 PM
Passing member functions to C functions? Steven T. Hatton C++ 7 10-07-2004 02:12 AM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM
Help! Passing Templates functions to template functions ILLOGIC C++ 1 06-01-2004 10:51 PM
Exportable class functions as stand alone functions to .DLL or .SO Timothy Wong C++ 3 05-20-2004 01:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57