#include <stdio.h>
# include <stdio.h>
Yes,we can compile our program without header file without any error,but we can not use any predefine functions like printf,scanf.
EX: pgm #include<stdio.h> main() { printf("haiii"); } Header file: (1) contains the function(printf) declaration (2) during preprocessing, the printf function is replaced by the function declaration Library file : (1) contains the function(printf) definition (2) during linking, the function declaration is replaced with the function definition.obviously, everything will be in object while linking
the use of header files is to add functionality. Header files are basically saying put code in that header file here so you don't have to type that many lines of code.
Header file is a file which is meant to be included into another file during compilation. Examples: string.h, stdio.h, inttypes.h. Header pointer is a pointer to an object called header (for example header of a linked list).
The header file of graphics in TurboC is graphics.h
tanga
printf() is a build-in function under the header file 'stdio.h' in a C programming language. In c++,the same function is accomplished by 'cout' . It is used to display strings enclosed between double quotes. Its syntax is printf("...string/sentences/characters...."); After execution,all the characters between the double quotes will be displayed on the output screen.
#include<stdio.h> #include<conio.h> int main(void) { int sum=0,n,i; clrscr(); printf("\n Enter two no."); scanf("%d%d",&n,&i); sum=n+i; printf("\n%d+%d=%d,n,i,sum); getch(); return 0; }
use grphics.h header file
Header files are not much different from usual cpp files. There are basically two different things. It's file extension: you need to choose "header file" when you create it or save as .h file. Second is header files do not have main() function. When you are done with you header file do not forger to include it in your project by writing preprocessor directive:#include "your_header_file.h"
stdbool header file use for a new data type that is boolean value