Using your inkey function you could:
void number_input() {
inkey((t_input.pstring)[0]);
result= str_to_int((t_input.pstring)[0]);
}
//in your other function
for (i = 0; i < 3; i++) {
number_input();
while (proc_status(number_input)) {
wait(1);
}
loc_i2 = result;
}
the reason for this is that inkey will internally exicute a wait and will cause your function to return to the caller.