This is a simple code, it prints Cat and Dog. It won't print Cat, Cat, unless you have an error elsewhere. Are you looking for TRACE
or OutputDebugString
?
CStringArray arr;
arr.Add("Cat");
arr.Add("Dog");
for (int i = 0; i < arr.GetSize(); i++)
{
const char *temp = arr[i];
TRACE("%s\n", arr[i]);//add break point here to look at temp
//or
//OutputDebugString(arr[i]);
//OutputDebugString("\n");
}
ps, I think you want to use breakpoints and look at arr[i]
on the fly. You can use const char *temp = arr[i]
it will make the nth element visible. Otherwise I don't know.
pss, debug feature Autos may not show the value at temp
depending on where you put breakpoint, because it makes decisions automatically. But you should be able to look at it by just moving the mouse over to temp
.