Anonymous user
Hostname: Difference between revisions
added C, Perl
(-> IDL) |
(added C, Perl) |
||
Line 2:
Find the name of the host on which the routine is running.
==[[C]]==
[[Category:C]]
'''Compiler:''' [[GCC]] 4.0.1
'''Standard:''' [[POSIX.1]]
#include <limits.h>
#include <unistd.h>
int main()
{
char name[_POSIX_HOST_NAME_MAX+1];
gethostname(name, _POSIX_HOST_NAME_MAX+1);
}
==[[IDL]]==
Line 7 ⟶ 22:
hostname = GETENV('computername')
==[[Perl]]==
[[Category:Perl]]
'''Interpreter:''' [[perl]] 5.8.6
use Sys::Hostname;
$name = hostname;
==[[Tcl]]==
|