Thread: object members

  1. #16
    Registered User
    Join Date
    May 2002
    Posts
    317
    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;
    }

  2. #17
    Registered User blight2c's Avatar
    Join Date
    Mar 2002
    Posts
    266
    yup, i realized that what made it print was an <<endl after the cout<<"blah". but i haven't a clue how it works. i stole that function from c_coder (some brit on the board now and again).
    i haven't yet studied the time.h library--i think that's atleast a month away yet.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Telling a shared_ptr not to delete object?
    By TriKri in forum C++ Programming
    Replies: 5
    Last Post: 08-16-2008, 04:26 AM
  2. Replies: 60
    Last Post: 12-20-2005, 11:36 PM
  3. Another Dynamic Memory Question
    By SirCrono6 in forum C++ Programming
    Replies: 6
    Last Post: 03-02-2005, 12:10 PM
  4. Creating object of type HWND from a dll
    By Unregistered in forum Windows Programming
    Replies: 2
    Last Post: 03-13-2002, 12:40 AM