Hi,
the following code
prints as port number 5888 but in /etc/services this protocol has default port 23. And generally, getting port value with this function for any service differs from the values written in /etc/services. Why is that happening?Code:int main()
{
struct servent* se = getservbyname("telnet", "tcp");
printf("%d\n", se->s_port);
}
Thanks