Доступ к элементам структуры осуществляется с помощью оператора точки. Для переменных-указателей используйте оператор ->.
details_1 d1 = {'c', 1};
details_2 d2 = {999999,'b'};
details_union du = {d1};
printf ("Access student directly: %c\n",d1.student);
printf ("Access student through union: %c\n",du.COUNT8.student);
printf ("Access pin_code through union: %lu\n\n",du.COUNT16.pin_code); // not this value
du.COUNT16=d2;
printf ("Access pin_code directly: %lu\n",d2.pin_code);
printf ("Access pin_code through union: %lu\n",du.COUNT16.pin_code);
printf ("Access student through union: %c\n",du.COUNT8.student); // not this value