Pointers in C

  • + 0 comments
    void update(int *a,int *b) {
        int sum,diff;
        
        sum = *a + *b;
        
        (*a >*b)?(diff = (*a - *b)):( diff = (*b-*a));
        
        *a = sum;
        *b = diff;
    }