dbansal wrote:
>
.... snip ...
>
I have a program. Please tell me what do you think about this.
ERROR: failure to #include <stdio.h>
>
int main(int x)
ERROR: main can have two or no parameters. Not one. Usual is:
int main(int argc, char **argv)
{
if(x==1)
{
int myval;
printf("size of integer myval: %d\n",sizeof (myval));
ERROR: printf without a prototype.
ERROR: sizeof returns size_t, not int. Use
("%lu\n", (unsigned long) sizeof myval);
}
else
{
float myval;
printf("size of real myval: %d\n",sizeof (myval));
ERROR: printf without a prototype.
ERROR: sizeof returns size_t, not int. See above.
}
ERROR: main returns int. "return 0;" will do.
}
So, apart from not being a legal C program, all is well.
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>