Get Hostname in C

We can get the hostname of the local machine with the function gethostname() by passing an empty string and its length. The string will be filled by the hostname returned by the function upon successful #Unix System Call.

#operating-system