Hi. I'm making a class in an include file. I ran into some touble...When i try to compile, this is what comes up:
c:\...\renew.h(25) : error C2660: 'localtime_s' : function does not take 1 arguments
c:\...\renew.h(36) : error C2660: 'asctime_s' : function does not take 1 arguments
Here is the code for the class ([#include time.h is in the main cpp file)
class renewBooks
{
public:
int getItems()
{
cout << "Please scan the barcode of the book you would like to renew.";
cin >> renewBarcode;
processItems(renewBarcode);
return false;
}
private:
string renewBarcode;
string toRenewItem;
int processItems(string toRenewItem)
{
char date[9];
_strdate_s(date);
char time2 [9];
_strtime_s(time2);
time_t now = time(NULL);
struct tm* tm = localtime_s(&now);
tm->tm_mday +=14;
// asctime(tm);
ofstream renew ("renewBooks.txt", std::ios::app);
renew << "Date: "
<< date
<< "\nTime: "
<< time2
<< "\nDue date: "
<< asctime_s(tm)
<< "\nBook barcode: "
<< toRenewItem;
renew.close();
return false;
}
};