Pointers in C

Sort by

recency

|

697 Discussions

|

  • + 0 comments

    This explanation of pointers in C does a fantastic job of breaking down one of the most important — yet often confusing — concepts in programming. Funinexchange ID Login

  • + 0 comments

    t456

  • + 0 comments
    void update(int *a,int *b) {
        if (*a<*b){
    	*a+=*b;
            *b=((*a-*b)-*b)*(-1);
        }
        else{
    	*a+=*b;
            *b=((*a-*b)-*b);
        }
    }
    
  • + 0 comments

    C is a timeless, powerful language—lightweight and close to the metal, perfect for building fast, portable systems-level software; mastering it gives you a solid foundation for how computers really work. t20 exchange registration

  • + 0 comments

    include

    void update(int *a,int *b) { int sum = *a + *b; int diff = *a - *b; if(diff < 0){ diff = -diff; } *a = sum; *b = diff;
    }

    int main() { int a, b; int *pa = &a, *pb = &b;

    scanf("%d %d", &a, &b);
    update(pa, pb);
    printf("%d\n%d", a, b);
    
    return 0;
    

    }