I have look around and around, and now matter what I seem to do I just can't seem to get this to work. I don't understand what I'm doing wrong. I've tried it with 'struct' in front of 'tm *today' as well
When I debug it, I get "Error 2 error C2228: left of '.tm_mon' must have class/struct/union". Which I don't get since I thought I had declared it.
Code:
#include <stdio.h>
#include <iostream>
#include <ctime>
using namespace std;
int main ()
{
char test;
time_t now;
tm *today;
time(&now);
today=localtime(&now);
cout << today.tm_mon << endl;
cout << "Did it work?";
cin >> test;
return 0;
}
What am I doing wrong?