Thread: How do I put time in enqueue link list?

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    7

    How do I put time in enqueue link list?

    I need help on how to enqueue time. An example is
    Code:
     pqueue.enqueue("Name", 11:00);
    But it will read an error because the ( : ) is there. So how can I do it so that I can output time.

    Desired outpout:

    Name 11:00

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    your container class will need to accept the time as a string, and (optionally) convert it to some internal time representation.

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    You can store time as a string, as a custom struct, or as a time_t. If you're not doing arithmetic with time, then a string is simplest. But you can't just write 10:00 and expect the language to interpret it as time.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reserve a range in virtual memory at link time
    By pheres in forum Windows Programming
    Replies: 11
    Last Post: 12-10-2009, 11:15 AM
  2. Replies: 35
    Last Post: 10-27-2006, 11:12 AM
  3. Link List
    By siavoshkc in forum C++ Programming
    Replies: 59
    Last Post: 08-01-2006, 11:48 PM
  4. Left justification using linked list of link list
    By hykyit in forum C Programming
    Replies: 7
    Last Post: 08-29-2005, 10:04 PM
  5. link time error
    By gazsux in forum C++ Programming
    Replies: 5
    Last Post: 01-08-2003, 03:49 PM