gethostbyname xcode issues

前端 未结 1 1134
故里飘歌
故里飘歌 2021-01-25 22:00

Hey guys, I\'m new at this stuff, but I\'m trying to use gethostname() to work using xcode and the ipad. I\'ve tried a couple of things, but they all seem to freeze up.

1条回答
  •  情话喂你
    2021-01-25 22:11

    I'm an idiot. If I do:

    char server[256];
    [Website_NSString getCString:server maxLength:256 encoding:NSASCIIStringEncoding];
    host = gethostbyname(server);
    

    It works fine.

    0 讨论(0)
提交回复
热议问题