You know, I've been playing with your wait function and it never would output the cout statement. However this works for me:
Code:int f_wait(float SecondsToWait) { clock_t delay = SecondsToWait * CLOCKS_PER_SEC; //convert to clock tics clock_t start = clock(); while(clock() - start < delay) ; return 1; }