/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>

struct foo
{
    long int a;
    long int b;
};

void bar1(struct foo *f)
{
    printf("bar1: address of data: %p\n",f); 
    printf("bar1: values at entry: %d %d\n",f->a,f->b);
    f->a++;
    f->b++;
    printf("bar1: values at exit: %d %d\n",f->a,f->b);
}

void bar2(struct foo *f,int v)
{
    printf("bar2: address of data: %p\n",f); 
    printf("bar2: values at entry: %d %d\n",f->a,f->b);
    f->a += v;
    f->b += v;
    printf("bar2: values at exit: %d %d\n",f->a,f->b);
}
