我解析了C中的一个http头并且需要从完整的url中减去主机名。解析字符串并减去一个子字符串
我设法得到完整的网址(http://www.example.com/hello.html)和路径名(hello.html),但不能减去(完整的URL - 路径名)主机名(example.com)。
Example full url: http://www.example.com/hello.html - DONE
host name: example.com - TODO
path name: /hello.html - DONE
任何帮助,将不胜感激。由于
只是用'strncpy' – 2013-05-02 16:30:59
你读在C http头,不知道处理字符串?在问之前你应该在网上搜索。 – erencan 2013-05-02 16:34:52