GooMooPunch
Programmer
Hello,
I'm trying to print out the user's name, but am receiving an error:
------
struct passwd* user = getpwuid(getuid());
printf("\n %s \n", user.pw_name);
---------
the error I receive is:
request for member "pw_name" in something not a structure or union
-----
I'm not quite sure why this is happening...what can I do to print out the pw_name from the passwd structure?
Thanks
I'm trying to print out the user's name, but am receiving an error:
------
struct passwd* user = getpwuid(getuid());
printf("\n %s \n", user.pw_name);
---------
the error I receive is:
request for member "pw_name" in something not a structure or union
-----
I'm not quite sure why this is happening...what can I do to print out the pw_name from the passwd structure?
Thanks