#include struct foo_struct { int x; float y; }; void init_foo_struct ( struct foo_struct * f, int a, float b ) { f->x = a; f->y = b; } void print_foo_struct ( struct foo_struct * f ) { printf ( " x = %d, y = %f\n", f->x, f->y ); } int main () { struct foo_struct f; /* use functions */ init_foo_struct( &f, 42, 3.14 ); print_foo_struct( &f ); /* or directly access */ f.x = 11; f.y = 1.01; printf ( " x = %03d, y = %07.3f\n", f.x, f.y ); return 0; }