Because atoi takes a pointer to a C style null terminated string as an argument, and that's what c_str returns.

difftime would be pretty useless if you couldn't specify the times you were interested in.