>I tried a different Approach to achieve the same
It's not only "different" approach: it's a wrong approach

.
The C Standard (7.4.1.10):
The standard white-space characters are the following:
space (' '), form feed ('\f'), new-line ('\n'), carriage return ('\r'),
horizontal tab ('\t'), and vertical tab ('\v'). In the "C" locale,
isspace returns true only for the standard white-space characters.
Therefore the code above can't select word in "123four5six..." string. Also it has obviously incorrect lines, for example:
while (ptrFirst) { // probably, must be *ptrFirst
More subtle defect of the code above is that isXXX family function do not work for negative arguments. If a character in a text file has a bit value '1xxxxxxx' and implementation char type is signed then [icode]*ptrIter[/code] expression gets negative integer and [icode]isalpha(*ptrIter)[/code] result is undefined. That's why Uchar typedef was defined in my code.
In actual fact it's inaccurate implementation of the same (scanner-like) approach
Apropos, if we have text file with whitespace separators only, no need in scanner-like methods at all. The simplest code works fine:
string word;
while (file >> word) {
// process word
}