What do you expect that line to do? You are trying to put user input to a defined string (meaning that ":" is not a variable which you can assign stuff to as it is already defined as ":"). If what you are trying to do is print the variables and the colon, use cout<<.