In my program I am trying to display today's date in a day//month//year layout. I've tried using many different ways but I keep getting errors about unsafe use of cTime.
Is there a simple way of getting my program to show the date:
time_t t = time(0); // get time now
struct tm * now = localtime( & t );
cout << (now->tm_year + 1900) << '-'
<< (now->tm_mon + 1) << '-'
<< now->tm_mday
<< endl;
I keep getting "'localtime': This function or variable may be unsafe. Consider using localtime_s instead." So I did, and now I get 'localtime_s' : function does not take 1 arguments