October 7th, 2003, 10:47 PM
Code Needed: Linux GetComputername Function
i need to know abt GetComputerName function in linux c++ ..how it work,the parameter needed,the condition,the header or bla bla..if can..post me the sample code..thanks for helping me..
October 7th, 2003, 11:09 PM
October 7th, 2003, 11:17 PM
Use gethostname(). You might want to read the man page for gethostname for more information :)
size_t namelen = MAXHOSTNAMELEN;
if (gethostname(name, namelen) != -1)
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
October 7th, 2003, 11:19 PM
iitzit the function work same as getcomputername?