Library Question

Home Forums C Programming Library Question

This topic contains 2 replies, has 2 voices, and was last updated by  RomanMcKeon 8 years, 2 months ago.

  • Author
    Posts
  • #2232

    RomanMcKeon
    Member

    New member, first question

    I have a reasonably good understanding of VB programming and have just started to look into c++

    Apart from many other concepts I’m trying to get with, I am trying to understand more about what exactly libraries are.

    From what I have read so far my understanding is that library is simply a collection of pre constructed useful functions, variable constants, class objects, etc

    My other question is if I write a program which includes a library, does the whole of the library get compiled with the program, or just the functions that are actually used

    Thanks
    Jeff

  • #3613

    You pretty much got the idea about library functions. Most C/C++ compilers have a folder named “include” that has a number of “header” files that can be added to a project by using the preprocessor directive “#include” and then the header file in angle brackets ( like #include < iostream.h> ). There are a whole group of standardized header files each with a certain type of pre-built functions. stdio.h ( stands for standard input output ) , for example , has certain functions for input and outputing things to the screen and files. When you include a certaing “header file” you import all the functions in the file to your project , so this can add to your projects size. However , C/C++ is low level enough that you can write many of these functions your self instead of including them , or since many C/C++ have inline assembly language capabilties you can write your own custom set of utilities , if you desire. Many compilers come with executables that allow the user to compile and create their own header files as well. You’ll find C++ to be much more powerful than VB ……..

  • #3614

    RomanMcKeon
    Member

    dman

    Thanks for your reply

    Jeff

You must be logged in to reply to this topic.

0 Shares
Share
+1
Tweet
Share
Stumble