On Tue, Jul 14, 2009 at 5:21 AM, anurag JAIN <[email protected]> wrote:
>
> Hi,
>
> Initially the value of a is 5.
>
> c=a/++a; means
> c= 5/6

No it doesn't. It's permissible for the compiler to _also_ interpret it as:
c = 6/6

> ; so C=0;

... so that's wrong.

Neither method is wrong, and because both are valid, the construct
'a/++a' shouldn't be used in C because it is not well defined.

> d=++a/a++; means
> d= 7/7;

No it doesn't. Another permissible interpretation is

d = 7/6

--
PJH

http://shabbleland.myminicity.com/com
http://www.chavgangs.com/register.php?referer=9375

Reply via email to