Thread: probably a very easy question...

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    55

    probably a very easy question...

    I've written a program that in one instance it calls:
    Code:
    system("date +%d%m%y");
    but instead of the normal output in the terminal, I want to read this as either a string or integer. I'm still struggling on how to do this, so has anyone got any ideas?

    thanks in advance
    Spiros

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    You can do so much more by just calling strftime() with whatever conversion string you like, and with whatever date/time you like (not just 'now' as with the date command).
    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.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    55
    thanks, actually, I was just looking at that!. I'll try and use it and I'll report back.

    Thanks
    Spiros

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. easy Vector contructor question
    By noodle24 in forum C++ Programming
    Replies: 5
    Last Post: 04-21-2006, 07:43 PM
  2. Another Embarassingly Easy Question
    By almo89 in forum C Programming
    Replies: 2
    Last Post: 02-11-2006, 04:59 PM
  3. This is hopefully an extremely easy question...
    By rachaelvictoria in forum C Programming
    Replies: 2
    Last Post: 11-07-2005, 01:36 AM
  4. 4 easy question
    By Zeratulsdomain in forum C++ Programming
    Replies: 2
    Last Post: 10-15-2005, 10:43 PM
  5. Easy Question
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 08-12-2002, 12:19 PM