Skip to main content

Header files


        Header files or Libraries (as they are commonly known as) extends the Languages's functionality..C Language supports only the most basic features that it needs.C language does not even contain functions to read from the keyboard and write to the screen. such extended functionalities are written by programmers and are placed in Header files which are reusable.Header files help you to split up your program into modules.


How to include header files in your program? (only for beginner level)
      The statement you always write in your c program at the beggining.
 yaa.. you are actully including the header files.

we use preprocessor directives or commands which starts with #.
syntax :   #include<header file name . h>

why we include header files such as stdio and conio? (conio not for linux)
stdio.h:
Most of the C input/output functions are defined in stdio.h.It is a part of the Standard C Library
refer the header file for the list of available functions.the most commonly used are printf,scanf.
conio.h:
conio.h is a C header file used in MS-DOS compilers for performing "console input and output" from a program.It is not a part of the Standard C library.Compilers that target non-DOS operating systems, such as Linux,Win32 do not support this header file.
beside these, the Standard C Library contains a large number of functions for tasks like string handling, mathematical computations, input/output processing, memory allocation and several other operating system services.
If you are using turbo c++ compiler you can see the header files with the function present in that header file in help section.
Here I m providing small list of usefull header files.

math.h   it provides many useful functions such as cos,sin...,log,mod,pow etc.
string.h  it provides many string handling functions to compare,concatenate strings,to find their length
                we will see this deeply later on.
malloc/calloc for allocating memories and for memory manegment functions.
stdlib.h  this header file has variety of different methods.
In short we use header files so that we can use in-built functions.
In further sections, We'll see how to create your own header files.Till then enjoy using the in-built ones.

Comments

Popular posts from this blog

Pointers in C

Pointers are an extremely powerful programming tool. They can make some things much easier, help improve your program's efficiency, and even allow you to handle unlimited amounts of data. For example, using pointers is one way to have a function modify a variable passed to it. It is also possible to use pointers to dynamically allocate memory, which means that you can write programs that can handle nearly unlimited amounts of data on the fly--you don't need to know, when you write the program, how much memory you need. Wow, that's kind of cool. Actually, it's very cool, as we'll see in some of the next tutorials. For now, let's just get a basic handle on what pointers are and how you use them. What are pointers? Why should you care? Pointers are aptly name: they "point" to locations in memory. Think of a row of safety deposit boxes of various sizes at a local bank. Each safety deposit box will have a number associated with it so that you ca...

Types of Computer Networks(LAN,MAN,WAN)

Types of Computer Networks Computer networks are categorized according to: How they are organized physically. The way they are used. The distance over which they operate. Three main types of computer networks are as follows: LAN   (Local Area Network) WAN (Wide Area Network) MAN ( Metropolitan-Area Network) LAN (Local Area Network) LAN is the most common type of network . LAN stands for Local area Network . It covers a small area. Most LANs are used to connect computers in a single building or group of buildings. Hundreds or thousands of computer maybe connected through LAN. Typical LANs can be found in industrial plants, office buildings, and college or university campuses. LANs are capable of transmitting data at very fast rate. Data transmission speeds of LAN are 1 to 100 megabits per second. It is much faster than data transmission over a telephone line. LAN can transmit data in a limited distance. There is also a limit on the number of...

Ring topologies

Ring topologies are similar to bus topologies, except they transmit in one direction only from station to station. Typically, a ring architecture will use separate physical ports and wires for transmit and receive. Token Ring is one example of a network technology that uses a ring topology.