Hostname: Difference between revisions

Content added Content deleted
Line 4: Line 4:


=={{header|Ada}}==
=={{header|Ada}}==
with GNAT.Sockets;
Works with GCC/GNAT
Depending on need.
with Ada.Text_IO;
<pre>
<pre>
Name : constant string := GNAT.Sockets.Host_Name);
procedure Hostname is

begin
Name : Unbounded_String;
Ada.Text_IO.Put_Line(GNAT.Sockets.Host_Name);
Name := TO_Unbounded(GNAT.Sockets.Host_Name);
end Hostname

Name : Access String;
Name := new String'(GNAT.Sockets.Host_Name);
</pre>
</pre>