URL路径拆分: 例如我们传入 http://www.baidu.com/index.php 拆分为 www.baidu.com 和 /index.php
代码语言:javascript复制#include <Windows.h>
#include <iostream>
int ParseUrl(char szUrl[], char szHost[], char szPath[])
{
int iStart = 0;
int iEnd = 0;
int iLen = 0;
if (strncmp(szUrl, "http://", 7) == 0)
iStart = 7;
else if (strncmp(szUrl, "https://", 8) == 0)
iStart = 8;
while (szUrl[iStart iLen] != '