Generator in C