dimanche 7 août 2016

Can somebody please explain, how this C++ code works?

I'm learning c++, but I just can't get my head around this. I can't just memorize it either, without knowing how it works.

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);

    return buf;
}

Aucun commentaire:

Enregistrer un commentaire