Code:
#include <iostream>
#include <ctime>
#include <string>
using namespace std;
int main()
{
time_t now;
struct tm *d;
string li = "mm-dd-yyyy"; // filler string
time(&now);
d = localtime(&now);
strftime( li.data(), li.size(), "%d-%m-%Y", d);
cout << s, li;
}
./ctime_conv.cpp: In function ‘int main()’:
./ctime_conv.cpp:16: error: invalid conversion from ‘const char*’ to ‘char*’
./ctime_conv.cpp:16: error: initializing argument 1 of ‘size_t strftime(char*, size_t, const char*, const tm*)’
./ctime_conv.cpp:18: error: ‘s’ was not declared in this scope
./ctime_conv.cpp:18: error: expected `;' before ‘li’