I can't see what's wrong with your code (but there could be something in there, it's a bit convoluted) but this works on my compiler and uses the same function calls:
std::tm t = { 0, 0, 12, 13, 6, 110 };
std::time\_t int\_rep( std::mktime( &t ) );
t = \*std::localtime( &int\_rep );
std::cout << std::asctime( &t ) << std::endl;
It's a bit disgusting but seems to get the job done. I'd be tempted to wrap it up in a function though:
int day_of_week( int day, int month, int year )
{
std::tm t = { 0, 0, 12, day, month - 1, year - 1900 };
std::time_t gratuitous_l_value( std::mktime( &t ) );
return std::localtime( &gratuitous_l_value )->tm_wday;
}
If you're programming in C and not C++ just remove the std:: everywhere, include time.h and not ctime and convert the constructor style initialisations to = and it'll probably work. Cheers, Ash