Home › Forums › C Programming › Library Question
- This topic has 2 replies, 2 voices, and was last updated 15 years, 1 month ago by RomanMcKeon.
- AuthorPosts
- September 24, 2009 at 11:51 am #2232RomanMcKeonParticipant
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 - September 25, 2009 at 6:01 pm #3613GWILouisaxwzklaParticipant
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 ……..
- September 28, 2009 at 1:33 pm #3614RomanMcKeonParticipant
dman
Thanks for your reply
Jeff
- AuthorPosts
- The forum ‘C Programming’ is closed to new topics and replies.