Dont use scanf and gets for string input. Instead use fgets which is decribed in the second this of my previous post. You need to flush the input buffer (how to do that read the first this of my previous post). You need to flush the input buffer becouse if you not flush it you it will be unable to input the string second time. Please post your code.