"Paul Herring" <[EMAIL PROTECTED]> wrote:
> On 3/4/07, krishna kanna <[EMAIL PROTECTED]> wrote:
> > void main()
> 
> main() returns int, not float, struct foo or void.
> 
> >   {
> >   int i;
> >   for(i=0;i++;i<100)
> >   {
> >   printf("%d",i);
> >   }
> >   }
> >   what is the output of this program
> 
> There needn't be any. You don't have a \n in your output
> or a fflush().

The later is implicit on program exit. The more significant
issue is that there is no prototype for the variadic function
printf. So even with a \n or fflush(), its behaviour is
undefined.

Another issue is that text stream lines needn't be infinite.
Indeed, they are only required to be up to 254 characters IIRC,
so the line buffer may overflow long before i++ does.

-- 
Peter

Reply via email to