Thread: showing time

  1. #1
    Registered User Micko's Avatar
    Join Date
    Nov 2003
    Posts
    715

    showing time

    How can I show time in my program.
    Example in right bottom of screen I want to show time
    1:31 PM?
    I assume I'll need to use time.h but how can my clock work during program living?
    Thanks in advance

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well you need to read this FAQ to find out how to read the keyboard without stopping your program, and this FAQ entry to find out how to position the text cursor prior to displaying some text.

    Basically, you loop trying to read user input, and once per second/minute, you redisplay the time.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 10:43 AM
  2. time program showing time since epoch?
    By cus in forum Linux Programming
    Replies: 5
    Last Post: 01-10-2009, 01:56 PM
  3. Is this really true or it's just science fiction?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 145
    Last Post: 04-09-2002, 06:17 PM
  4. time class
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2001, 10:12 PM