In the following code,
#include<conio.h>
clrscr();
gotoxy(10, 20);
ch= getch(a);
we can see that the library functions have been called without defining their prototype, the three library functions: clrscr() gotoxy(int int) and getch() have their prototypes defined in the conio.h header file which appear in the header file itself like this,
void clrscr();
void gotoxy(int int);
int getch();
But in the following code how does the compiler know the prototype of the printf() function? Since the code gets executed without any errors, although in the first printf() the last int format specifier prints the garbage value and in the second the value of j doesn't get printed at all since it has not been specified.
#include<stdio.h>
int i=10, int j=20;
printf("%d%d%d",i,j);
printf("%d",i,j);
How does the header file stdio.h describe the scenarios when the format specifiers are float or char variables for the printf() functions?
.... Note that good compilers will find the error anyway. - EOF