3. A structure pointer is pointing to type time with 3 fields min, sec and hours having pointers to integers. Write the way to initialize the 2nd element to 10.
Please finish this question in C language programming
Thank you so much!
The way to initialize the 2nd element to 10 is given below:
time->sec = 10;
The complete source code for the structure pointer using main() method for testing is given below:
#include <stdio.h>
//structure
struct Time
{
int min;
int sec;
int hours;
};
int main()
{
//structure pointer declaration
struct Time *times;
//structure variable declaration
struct Time t;
//assign the structure time pointer variable
times = &t;
//assign value using structure pointer
times->min = 5;
times->sec = 10;
times->hours = 12;
//display value using pointer variable
printf("Min = %d\n", times->min);
printf("Sec = %d\n", times->sec);
printf("Hours = %d\n", times->hours);
return 0;
}
OUTPUT:

3. A structure pointer is pointing to type time with 3 fields min, sec and hours...