foo_t *lhs = &hoge[i][j]
if (a) *lhs = foo;
else *lhs = bar;
でいいんじゃね