system returns an implementation defined value, if it returns at all. Try something along these lines instead:
#include <cstdlib>
int main()
{
std::system("date /t > example.txt");
std::system("time /t >> example.txt");
}
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004