I am trying to find out how to get the date (day of week; day of month with 1st, 2nd, etc; month; and year). In Microsoft Visual C++ 2010 Express, the underlined section of the following code gets the error:
int tm::tm wday
Error: a nonstatic member reference must be relative to a specific oject
1 2 3 4 5 6 7 8
#include <iostream>
#include <time.h>
usingnamespace std;
int main ()
{
int a;
a = tm.tm_wday;
}
"a = tm::tm_wday;" gets the same error.
Please help me remove this error.