In one function of my code I found a bug. It was written std:string
:
const std::string currentDateTime() {
time_t now = time(0);
struct tm tstruct;
char buf[80];
tstruct = *localtime(&now);
//strftime(buf, sizeof(buf), "%Y-%m-%d.%X", &tstruct);
strftime(buf, sizeof(buf), "%Y%m%d%X", &tstruct);
std:string str = buf;
str.erase(std::remove(str.begin(), str.end(), ':'), str.end());
return str;
}
The code compiles without errors. Why does it compile? What does std:string
mean then?