Monday, December 28, 2015

Header Files

   >>> Some of these instructions come in computer files that you simply "put" in your program. Theses instructions or files are also called libraries.

   >>> To make your job easier, some of these libraries have already been written for you so that as you include them in your program you already have a good foundation to continue your construction.

 >>> There are libraries previously written for you.

   >>> The libraries are files that you place at the beginning of your program as if you were telling the computer to receive its preliminary instructions from another program before expanding on yours.

   >>> The libraries are computer files they have the extension ".h". An example would be house.h or person.h. As you see, they could have any name; when you start creating your own libraries you will give your files custom and recognizable names.

   >>> The first library we will be interested in is called iostream. It asks the computer to display stuff on the monitor's screen.

    #include iostream.h

   >>> There are usually two kinds of libraries or filers you will use in your programs: libraries that came with c++ and those that you write. To include your own library you would enclose it between double quotes like this

       #inlclude "book.h"

   >>> When you include a library that came with c++, you enclose it between < and > as follows:

        #inlucde <iostream.h>

   >>> Following this same technique, you can add as many libraries as you see fit.

   >>> Before adding a file, you will need to know what that file is and why you need it. This will mostly depend on your application. Suppose you want to write a program in which you implement mathematical operations that time you have to add Math.h header file.

No comments:

Post a Comment