Inserting date to a char array?

It would really mean a lot if someone could give me an example of how to insert system date in a char array.
Something like this:
1
2
char dateNow[50] << systemdate
//i really have no idea 

Ive looked everywhere(on google) but I cant find any example and since Im still a student and the school urges me to use turbo c++ if someone can make it with that compiler i will be very very grateful. Thank you in advance :)
Last edited on
What is that 'systemdate'?
The reference section on this site is a rich source of information and sample code. Take a look here:
http://www.cplusplus.com/reference/ctime/asctime/

and here - the strftime() function lets you specify the date and / or time in pretty much any format you want.
http://www.cplusplus.com/reference/ctime/strftime/

Though usually I'd discourage the use of turbo c++ as it is very old and doesn't support ISO standard C++, nevertheless the code samples on those pages should work ok with that compiler.
Last edited on
@Chervil thankyou for that I tried it out and it worked perfectly..

I have another question.. How do I convert a char array to time? Id like to use difftime() but first I need to convert the char array to an actual time.. Can someone point me to the right direction?
Topic archived. No new replies allowed.