Difference between library and headers

This is a discussion on Difference between library and headers within the C++ Programming forums, part of the General Programming Boards category; I cannot really grasp the diffence bettween a library and a header. Ive checked the faq and found a "half" ...

  1. #1
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343

    Question Difference between library and headers

    I cannot really grasp the diffence bettween a library and a header. Ive checked the faq and found a "half" answer. It says "A header file is just a pointer to the .lib". Why do you then include both headers and libraries in the same source code???
    Thx in advance

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    A header file will contain all the decalarations for the functions in the library. You need the header file so the compiler can check that you are calling the functions in the library correctly (although the linker will produce an error if you try to call an undefined function), and you can use a header file if you don't have any other documentation about what functions the library contains.
    zen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Which of the C 'Standard Library headers' are worth rembering?
    By Ravens'sWrath in forum C Programming
    Replies: 24
    Last Post: 05-17-2007, 02:12 AM
  2. im extreamly new help
    By rigo305 in forum C++ Programming
    Replies: 27
    Last Post: 04-23-2004, 11:22 PM
  3. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 07:26 PM
  4. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 03:49 AM
  5. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21