std::cin input being skipped?

nano511 (361)
Some input is being skipped and it sets the variable to null or empty or something. Here is the relevant code
1
2
3
4
5
6
7
8
9
10
11
12
13
short int bindedPort;

//prompt for the port
std::cout<<"What port would you like to bind to?"<<std::flush;
std::cin >> bindedPort;
std::cout << std::endl;

 std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );

// Let the server know this client is connected
std::string ID;
std::cout<<"\nEnter an ID: "<<std::flush;
ID = std::cin.get();


The first cin works but the second one is skipped and an empty string is sent to the server. Can someone help me?
Registered users can post here. Sign in or register to post.