A
al.cpwn
int foo(int a)
{
return a++ * ++a;
}
On both Msvc++ and gcc I'm getting f(5) = 36. Shouldn't it be 30?
{
return a++ * ++a;
}
On both Msvc++ and gcc I'm getting f(5) = 36. Shouldn't it be 30?
int foo(int a)
{
return a++ * ++a;
}
On both Msvc++ and gcc I'm getting f(5) = 36. Shouldn't it be 30?
int foo(int a)
{
return a++ * ++a;
}
On both Msvc++ and gcc I'm getting f(5) = 36. Shouldn't it be 30?
int foo(int a)
{
return a++ * ++a;
}
On both Msvc++ and gcc I'm getting f(5) = 36. Shouldn't it be 30?
Peter_Julian said:A programmer can ill afford playing games with his or her code. For all you
know, a service pack (or a client's specific compiler or compiler version)
can, and often does, modify the result. The rules in C++ are specifically
written to free a coder from such issues.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.