http://bytes.com/topic/c/answers/646042-get-username-string-windows-c WIndows & *nix http://en.wikipedia.org/wiki/Environment_variable Only *nix http://linux.die.net/man/7/environ on Windows #include char*user=getenv("USERNAME"); on *nix #include char*user=getenv("USER");