unix_socket明明是个整数类型,这里为什么要求使用const char*类型?很郁闷,求教于各位大虾

解决方案 »

  1.   

    MYSQL *mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned long client_flag) If unix_socket is not NULL, the string specifies the socket or named pipe that should be used. Note that the host parameter determines the type of the connection. 因为如果IP地址一样,同样也可以是域名。所以是 char*
      

  2.   

    因为如同IP地址一样,同样也可以是域名。所以是 char*打错了。