I wanted to print something using printf() function in C, without including stdio.h, so I wrote program as :
int printf(char *, ...);
int main(void)
{
printf("hello world\n");
return 0;
}
Is the above program correct ?
I wanted to print something using printf() function in C, without including stdio.h, so I wrote program as :
int printf(char *, ...);
int main(void)
{
printf("hello world\n");
return 0;
}
Is the above program correct ?
works just fine, I don't know why people are telling you that char needs to be a const
Just:
It will tell you
printf
signature:this is the right one.
Here is another version of the declaration:
The correct declaration (ISO/IEC 9899:1999) is:
But it would be easiest and safest to just
#include <stdio.h>
.I have no idea why you'd want to do this.
But it should be
const char *
.