October 7th, 2003, 11: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 8th, 2003, 12:09 AM
October 8th, 2003, 12:17 AM
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 8th, 2003, 12:19 AM
iitzit the function work same as getcomputername?