It has been a long while since I did any C programming. I am trying to read the utmp.h header on RHEL vs 5 but I am getting a little lost with the branching. I wanted to write a simple program that would create a struct of type utmp and then would print out each element name and type. Such as, "the first element is called ut_type and is an integer." I have:
This gives me the size of the structure, but I'd like to find each element. Is this possible?
Thanks!
Brad
Code:
#include <stdio.h>
# include <utmp.h>
int main(int argc, char *argv[]) {
struct utmp ut;
int size;
size = sizeof(ut);
printf ("Size = %d\n", size);
}
Thanks!
Brad
Comment