Weird result for modulus operation

Andrew Pinski pinskia@gmail.com
Wed Apr 30 07:15:00 GMT 2008


On Tue, Apr 29, 2008 at 9:08 PM, Ang Way Chuang <wcang@nav6.org> wrote:
>  Thanks for the speedy reply. But why this code:
>
>         int a = 17, b = 16;
>         a = a++ % 16;
>
>  results in a = 2 then? I think I need to know what is sequence point. I'll
> google that.

As I mentioned, the code is undefined so it could be any value.

Thanks,
Andrew Pinski



More information about the Gcc mailing list