is there a way to return the current a account in c++?
i'm thinking of how to return something like "/home/babag."
i have a small app that i need to run on more than one box.
once in the account, the paths will be pretty much the
same on each. i'm thinking that if i can return the account
home path, i can store it in one variable and store the
rest of the path in ampther and put the two together to
form the path for the current box.
for example, each box might be in variable1, while a common
part of the path might be in variable2.
I am assuming the forward slash means you're on UNIX. In which case there are a couple of ways of getting the users home directory. The simplest is that there is usually a $HOME environment variable. Use the getenv() API call to retrieve it. The alternative means you're into something like getpwuid() which is a more secure, but more complicated way of doing it.