In most dialects of English, a "doubt" is what happens when someone
tells you something but you do not believe them. If you want something
explained, what you have is a question or an uncertainty.
On 2011-09-25, Anshum Kocher <> wrote:
> main()
You should declare this as:
int main(void);
> {
> unsigned int i=10;
> while(i-->=0)
> printf("%u ",i);
You should not use printf without #including <stdio.h>.
> int a[10];
> printf("%d",*a+1-*a+3);
You should not refer to uninitialized variables.
> }
> This leads to an infinite loop
It seems as though it would, yes.
> main()
> {
> unsigned int i=10;
> while(i-=1>=0)
> printf("%u ",i);
> int a[10];
> printf("%d",*a+1-*a+3);
> }
> But this does not why?
Parentheses.
What you have written is:
while (i -= (1 >= 0))
...
so we calculate whether 1 >= 0, it is, so (1 >= 0) is 1, and this is
equivalent to
while (i -= 1)
which terminates when i is 0.
-s
--
Copyright 2011, all wrongs reversed. Peter Seebach /
usenet-
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.