Simply access the members of the struct:
printf("The tm_seconds field is %d\n", timeinfo->tm_sec);
In other words, if you have a pointer to a value of type struct tm
, you can use the arrow operator (->
) to access any of the members. The tm_sec
member has type int
, like all the other members.
You could copy the value:
int my_seconds = timeinfo->tm_sec;
and then print the copy, too:
printf("my seconds are %d\n", my_seconds);