All pastes #252382 Raw Edit

Unnamed

public c v1 · immutable
#252382 ·published 2006-11-19 12:50 UTC
rendered paste body
#include <stdio.h>int setvars(int *, int *);int main(int argc, char **argv){        int *a;        int *b;                 int result = 0;        int x, y;        a=&x;        b=&y;        /* which one is the better one of these two ? */        /* result = setvars(a,b);       */         result = setvars(&x,&y);        if (result == 0) {          printf("setvars: %d - %d\n", *a, *b);          return 0;        } else          return -1;}int setvars(int *a, int *b){        if ((a) && (b) ) {                printf("b: %p", &b);                *a = 10;                *b = 11;        return 0;        } else                return -1;}