getchar/gets issues

I'm making a console chat program, but it requires you to enter the type of connection you want (host or client) and the ip address of the other person if you're joining a connection... Problem is, after you type your connection type, the enter is read by gets after it, causing the program to receive "" as the ip address... Any suggestions to stop this?
Use std::getline() instead.
Topic archived. No new replies allowed.