how to access local variables outside loops?
Hi again to all. I tried to use google before asking dumb questions but i still need to ask one. :) I just did a lot of reading about pointers and referencing to try help my cause but my efforts were futile. i have a do while loop and within that has a while loop. now part of the condition for the outer do while loop lies within the interior while loop and the outer loop cant see the variables inside the while loop. i will paste part of the code here:
that tells me pos undeclared identifier. i noticed that every example i saw of pointers etc used integers and not strings so i do not know what to do.
some other code here, bla bla dont want to waste forum space, lol.
while (pos != string::npos)
cout << "Found space or dot at: " << pos << endl;
pos = name.find_first_of(" .", pos + 1);
} while ((name_length=0) && (pos !=0));