prototype of a function in c++ is mandatory to give.........but when we give the prototype of the function then there are alot of errors.....
see ex
int printf(const char*,...);
int scanf(const cahr*,...);
int kbhit(void);
void clrscr(void);
int main(void)
{
clrscr();
printf("hello");
while(!kbhit());
return 0;
}
file extension must be .cpp
when file extension is .c or any extension except .cpp then this program gives output hello......
The prototype only tells the current context that a specific function exists, and what it looks like. However, if you do not either:
1) provide a definition for the function in your code, or
2) link your code with an already compiled version of the function
then the compiler will complain.
Both printf() and scanf() are C standard library functions found in <cstdio> for C++ or <stdio.h> for C.
There is no such file as <cstdio.h>.
All the ones I listed for you are required by the language, so if your compiler is a valid C or C++ compiler, it will support them.