#include "matrix.h" VEC *my_function(VEC *x, VEC *out) { static VEC *temp = NULL; /* holds intermediate results */ if ( ! x ) error(E_NULL,"my_function"); temp = v_resize(temp,x->dim); /* do computations... */ return out = v_copy(temp,out); }