Thread: General Compiler question (Where can I read the functions?)

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    104

    General Compiler question (Where can I read the functions?)

    Where can I read the default functions in C? I'm using the Turbo c++ compiler. I want to see how the functions like atof, strcmp and all those work. I looked in the header files, like in string.h and found a line or two, looking like the function protoypes, but nothing else as to how they acually work. Where can I see how the functions work?

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    51
    although i'm not sure, i don't think u can. The only functions that u can c the source of are the STL of C++. I think only binaries exist for standard functions (.lib files).

    i think thats y for example in linux, for gcc u need to use the command

    -lm

    to use the math library even though u use the math.h header. And yeah, the headers would only contain prototypes and stuff, thats all the compiler need to know at compiler time, just the signatures of the functions. The actual functions are in binary.

    Like u would compile files separately and combine them as object file which are binaries, like .lib files.

    don't take my word for it though

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    That is correct.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    For your compiler - forget it

    Use gcc, and you can get everything
    http://www.gnu.org/software/libc/libc.html
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question about this compiler...
    By sangken in forum C Programming
    Replies: 3
    Last Post: 08-29-2006, 12:14 AM
  2. Question With Functions
    By jarvis in forum C Programming
    Replies: 28
    Last Post: 07-10-2006, 07:23 AM
  3. Compiler Question
    By blork_98 in forum C Programming
    Replies: 1
    Last Post: 03-10-2006, 06:00 PM
  4. question about functions
    By abyssphobia in forum C++ Programming
    Replies: 6
    Last Post: 08-18-2004, 06:22 AM
  5. Compiler Question.......
    By incognito in forum C++ Programming
    Replies: 1
    Last Post: 01-04-2002, 11:43 PM