Skip to main content

C Programming - 4.3 Header Files

Now, again see the first C program I wrote

#include <stdio.h>

int main()
{

     printf("I am a Programmer\n");

     return 0;
}


Now, what #include <stdio.h> means actually 

Here, stdio.h known as a Header file 😮, remember it's not studio.h 😜. So many persons done that mistake when he/she first write C codes

And, the coolest thing about header file is, it will give you a headache 😨


OK, I am just kidding 

Header file term refers to that kind of file which contains C function declarations and macro definitions. A C header file contains .h extension.

Like in this code stdio.h contains function declaration and definition of printf() that's why we had to include the stdio.h header file at the top of the code

The basic syntax of including header files on top of the code

#include <header_file_name>

Now, you can wonder about printf() function, don't worry we will learn it gradually


Some frequently used C header files along with frequently used functions  are listed below

stdio.h  - printf()
                 scanf()
                                     

stdbool.h - boolean data type support library

math.h  - abs()
                  pow()
                  sqrt()
                

string.h - strlen()
                 strcpy()
                 strcat()
                 strcmp()
                 

Now,
Don't fear guys you will learn these gradually as you walk through programming.
And one day you can teach someone too.

And as much as you walk, you will find this amusing.

Happy Coding
See You in the next tutorial


Next Post:


https://coderavens.blogspot.com/2018/05/c-programming-44-escape-sequence.html

Comments

Popular posts from this blog

C Programming - 3. Bits & Bytes

Bits Bits means the measurement of computer memory where we can store binary number or word. N-bits memory can store n-bits binary number or words for example :          1-bit memory can store either  1 or 0 because 1 and 0 are 1-bit binary numbers          2-bit memory can store:                                                   00                                                   01                   ...

C Programming - 4.1 First C program

First C program #include <stdio.h> int main() {      printf("I am a Programmer\n");      return 0; } Output:                    I am a Programmer In the next tutorials, we will understand this code point by point. Semicolon Issue we have to remember one important thing always end of every statement in C we have to put a semicolon From the first code, there are two statements        printf("I am a Programmer\n");        return 0; and both of them have a semicolon at the end of the line or statement Some people find this annoying 😒 but like it or  not we have to be careful about this Happy Coding See you in next tutorial Next Post: https://coderavens.blogspot.com/2018/05/c-programming-42-main-function.html

C Programming - 4.5 The printf() function

We have been talking about this guy for so long and he finally came And you will see him most of the time whenever you write a C code. So, What printf() function do? It basically prints everything within the double quotation . for example: printf("I am a programmer"); this prints:                     I am a Programmer In full code that will be- #include <stdio.h> int main() {      printf("I am a Programmer");      return 0; } Now, see another code  #include <stdio.h> int main() {      printf("I am a Programmer");      printf("I am a Programmer");      return 0; } the output will be:          I am a ProgrammerI am a Programmer The output is like this because we haven't use newline character to indicate the en...