cin >> url

Hello, I need help with this. I have an idea to let the user enter the url he wants. How can I accomplish this? I have tried this ;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;

int main()
{
    string url;

    cout <<"Enter url:";

    cin >> url;

    ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);

    return 0;
}


However that doesn't work. Can anyone help me?
Use getline instead of cin>>

 
getline(cin, url);
Topic archived. No new replies allowed.