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");
}
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401