например:
url - 1.2.3.4:5678/path1/path2.html
Необходимый вывод: Хост - 1.2.3.4, Порт - 5678, Ресурс - /path1/path2.html
Вот как я устал:
Код: Выделить всё
#include
#include
#include
using namespace std;
int main()
{
string url="http://qwert.mjgug.ouhnbg:5678/path1/path2.html";
size_t found = url.find_first_of("://");
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/43906956/split-url-into-host-port-and-resource-c[/url]
Мобильная версия