Cross-post from SO-  Palindrome finding function
Reading a file:

while(fin){ 

    fin &gt;&gt; str; 
    sWords.push_back(str); 
    if(!fin){ 
        break; 
    } 


You push the value str before checking it worked. It should be:

while(fin)
{ 
    fin &gt;&gt; str; 
    if(!fin){ 
        break; 
    } 
    sWords.push_back(str); 


Or even better would be:

while(fin &gt;&gt; str)
{    
    sWords.push_back(str); 


Why are you doing this:

    else{
        getline(fin, str);
    }


Mixing operator >> and getline() makes the code hard to read.
Either use all operator >> or use getline() to get a line at a time then parse the line internally.

Note:: operator>> will ignore the '\n' at the end of the line and work. So if your file is a list of words one per line there is no need to use getline(). If on the other hand your file is a lot of text and you only want the first word on each line then you need to use getline().

Method 1: Use operator>>

 // If your input file has one word per line (or you want to use all words)
 while(file &gt;&gt; word)
 {
      // Do stuff
 }


Method 1: Use getline()

 // If your input file contains lots of words
 // But you only want to use the first word on each line
 while(std::getline(file, line))
 {
     std::stringstream  linestream(line);
     linestream &gt;&gt; word;

     // Do stuff
 }


You seem to reversing the line just to print it:

reverse(sVec.begin(), sVec.end());                          
for(int i =0; i &lt; sVec.size(); i++){                                
    cout &lt;&lt; sVec[i] &lt;&lt; " is a Palindrome " &lt;&lt;endl;                                  
}                                                                                           


Rather than reversing the array, just iterate it in reverse order:

for(std::vector&lt;std::string&gt;::const_iterator&amp; loop = sVec.rbegin(); loop != sVec.rend(); ++ loop)
{                               
    cout &lt;&lt; (*loop) &lt;&lt; " is a Palindrome " &lt;&lt;endl;                                  
}                                                                                           


Note on efficiency:

Using push_back() on an vector can be in-effecient if you are pushing a lot of data. As evertime the vector runs out of space it must allocate more memory and copy the string to the new buffer. You help by pre-allocting space.

sVec.reserve(1000); // Guess at the size
                    // Note when the vector runs out of space it will approximately
                    // double its internal buffer.