newb to C, cant figure something out.

This is a discussion on newb to C, cant figure something out. within the C Programming forums, part of the General Programming Boards category; And why go through all that timer code? Why not just add at the bottom of main() before the return ...

  1. #16
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,157
    And why go through all that timer code? Why not just add at the bottom of main() before the return the following:
    Code:
     cin.get();
        return 0;
    }
    for C++
    Code:
     getchar();
        return 0;
    }
    for C

    A simple and direct screen pause.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

  2. #17
    cwr
    cwr is offline
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    868
    The "timer code" is a really bad idea because it thrashes the cpu in a busy wait by calling clock() over and over.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 3 dimensional figure volume
    By thekautz in forum C++ Programming
    Replies: 2
    Last Post: 01-20-2009, 04:22 PM
  2. Newb Question Character Counting
    By Wilder in forum C Programming
    Replies: 13
    Last Post: 06-22-2008, 11:37 PM
  3. trying to figure out someone's code for a plugin
    By paulpars in forum C++ Programming
    Replies: 4
    Last Post: 07-20-2006, 10:57 AM
  4. Newb C++ Programmer
    By Philandrew in forum C++ Programming
    Replies: 8
    Last Post: 10-19-2004, 08:44 PM
  5. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 11:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21