Thanks alot, bnertha, I wouldn;t have do it without your hint, I got my start kick off well, but struck with the function putpwent(). I do not understand the constraint and stream needed to be inside(). I'm nw able to call out the pwd.h and display it's contain. Can u advise more on the putpwent(), like what do i need in it. Thanks again.
getpwent() gets the next entry in the password file. Each time it is called it gets the next entry from that password file. If you are just adding you don't need to do this. You are also getting an entry from the end of the file so it may be a non-existent entry.
I'm not sure why you are calling putpwent twice if the first one succeeds
Finally you can't use '=' to assign a char array. You need to strcpy()