I am attempting to write a alarm clock which receives input from the user. My initial design was to have the user fill out the tm structure by hand. I found two different examples of this and am a little confused as to which I should use.

The first-
struct tm str_time;

str_time.tm_year = 2012-1900;
str_time.tm_mon = 6;
str_time.tm_mday = 5;
str_time.tm_hour = 10;
str_time.tm_min = 3;
str_time.tm_sec = 5;
str_time.tm_isdst = 0;

And the second-

struct tm * timeinfo;

timeinfo = localtime ( &rawtime );
timeinfo->tm_year = year - 1900;
timeinfo->tm_mon = month - 1;
timeinfo->tm_mday = day;

My main source of confusion is whether I should use the ->, or the str_time.blank method?