Re: Doubt
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 22:44:16 +1200
Anarki wrote:
int main(a,b,c,d,e,f,g)
{
printf("Size of a = %d\nSize of b =%d",sizeof(a),sizeof(b));
return 0;
}
The above program perfectly compiles in cygwin using gcc
and my questions are
1.How does the compiler know what are the types of variables a, b, c,
d, e, f and g?? Where is its declaration?
It's assuming they are int.
2.I haven't included stdio.h yet the printf compiles.The compiler
doesn't complain about the requirement of function prototype, why?
It does.
gcc /tmp/x.c
/tmp/x.c: In function 'main':
/tmp/x.c:3: warning: incompatible implicit declaration of built-in
function 'printf'
--
Ian Collins.
.
- Follow-Ups:
- Re: Doubt
- From: Anarki
- Re: Doubt
- References:
- Doubt
- From: Anarki
- Doubt