1. The problem you have is gets catches the EOL
you get after hitting return for the number of the kids. Adding something like getch()
before that gets()
should fix this. Or just use gets()
twice.
2. Use string
instead of string.h
- the second one is legacy AFAIK.
3. Don't mix C++ and C I/O. Use istream::getline()
or getline()
from the string
library.