Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can do it in C:

    #include <stdio.h>
    int main(void) {
        int a, b, c;
        int d = (a = 1, b = 2, c = 3, a + b + c);
        int e = (({int f = 1; e = f;}), e += 1);
    
        printf("d is %d \n", d);
        printf("e is %d \n", e);
    
        return 0;
    }
Edit: I just realized how strange the line e = ... is. I wonder if it yields different results with different compilers.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: