the example from the book is using integers as well. Is there a reason it does it that way, by creating a template for it. Don't you only have to do that if the data type may be different? Both ways work just fine so i'm not sure if there is some underlying issuer i'm missing here.
The general approach is always better than particular approach. Let assume that you also need to output an array of unsigned integers or of long integes what will you do? Write three different functions?
Ya, I understand the reason behind the general approach. But if I declare my vector like this vector<int> possiblePalindrome; there really isn't any question about the type so i would be safe in not creating the template print function. Right? Or am i wrong.