The ternary operator requires the ':' and all its results to have the same type, try this: cout << "whatever I want to say..." << (newline==true ? '\n' : '\0' );
'\n' is the new line character and '\0' is the string terminator character (not displayed)