Add the include statement of header file string.h, to use the function strlen() and memset() explicitly.
Modify the output argument's type from 'n' to 'd' for printing the port number.