#include static struct test_struct *gtsp; struct test_struct { int flags; char *p; char *comm; }; char *write_buf(struct test_struct *tsp) { int i; *tsp->p = 'A'; return tsp->p; } int main_loop(void) { unsigned int n; char *p; int f = -1; for (n = 0;; n++) { p = write_buf(gtsp); } return 1; } int main(int argc, char *argv[]) { struct test_struct ts; ts.flags = 0x11; ts.comm = "this_is_command"; ts.p = NULL; gtsp = &ts; main_loop(); exit(0); }