You could define x,y,z in a structure and make a function which adds the values
Code:
#include <stdio.h>
#include <stdlib.h>
struct point_t
{
int x;
int y;
int z;
};
/* Add 'k' to x, y, z */
void add_k(struct point_t *p, int k);
int main(int argc, char *argv[])
{
struct point_t point;
int k = 4;
point.x = 1;
point.y = 1;
point.z = 1;
printf("First Values:\tx=%d\ty=%d\tz=%d\n", point.x, point.y, point.z);
add_k(&point, k);
printf("Results:\tx=%d\ty=%d\tz=%d\n", point.x, point.y, point.z);
return EXIT_SUCCESS;
}
void add_k(struct point_t *p, int k)
{
p->x += k;
p->y += k;
p->z += k;
}