First of all, please post to the group, not my private e-mail address.
Exposing your reply to few thousand people might help reveal problems in
your code.
Other thoughts on your post embedded below.
On 1/18/07, mzm_17 <[EMAIL PROTECTED]> wrote:
--- In [email protected], "Tamas Marki" <[EMAIL PROTECTED]> wrote:
>
> On 1/18/07, malaram kumhar <[EMAIL PROTECTED]> wrote:
> >
> > How does this expression could be solve and what is the value of
a and
> > b?
> > int a=13;
> > b=++a + ++a;
> >
>
> Modifying a variable twice between sequence points like this
produces
> undefined behavior.
> In other words, your compiler is free to do anything it wishes,
including
> formatting your hard drive or blowing up your monitor.
> Take my advice, don't do things like this, don't try to make up an
> explanation, it's futile, you'll learn nothing from it.
Reply:
#include<conio.h>
Non-standard header.
#include<stdio.h>
void main()
Non-standard definition of main, it should always return int.
{
int a=13,b,c;
b=++a + ++a;
printf("%i",b) ;
getch();
Non-standard function, and is also redundant (I hate it when programs wait
for me to press a button instead of giving back the control to the console).
}
ANS: b=30.
Your program shows what on your compiler the 'undefined behavior' does. It
proves nothing.
What's your point?
--
Tamas Marki